Skip to content
/ symmer Public
forked from UCL-CCS/symmer

Python package to reduce the qubit requirements of quantum simulation via qubit tapering and/or mapping the problem to a contextual subspace

License

Notifications You must be signed in to change notification settings

vinulw/symmer

 
 

Repository files navigation

symmer

Continuous_Integration codecov Unitary Fund

Symmer

A Python package for reducing the quantum resource requirement of your problems, making them more NISQ-friendly!

Installation

To install from the root of the project run:

pip install .

Basic usage

For basic usage see notebooks

Included in symmer:

Qubit reduction techniques such as tapering and Contextual-Subspace VQE are effected by the underlying stabilizer subspace projection mechanism; such methods may be differentiated by the approach taken to selecting the stabilizers one wishes to project over.

.symplectic contains the following classes (in resolution order):

  • PauliwordOp for representing general Pauli operators.
  • QuantumState for representing quantum statevectors.
  • ObservableOp for representing Hermitian operators, including expectation values and VQE functionality.
  • AnsatzOp is input into ObservableOp.VQE and contains a method for converting excitation terms to a quantum circuit.
  • StabilizerOp represents algebraically independent sets of Pauli operators for stabilizer manipulation/projections.
  • AnticommutingOp represents sets of anticommuting Pauli operators for the purposes of Unitary Partitioning and Linear Combination of Unitaries as in this paper.
  • MajoranaOp represents operators in the Majorana basis instead of Paulis, though the underlying symplectic structure is analogous.

.projection contains stabilizer subspace projection classes (in resolution order):

  • S3_projection for rotating a StabilizerOp onto some basis of single-qubit Pauli operators via Clifford operations and projecting into the corresponding stabilizer subspace.

  • QubitTapering

    • Performs the qubit tapering technique, exploiting $\mathbb{Z}_2$ symmetries to reduce the number of qubits in the input Hamiltonian while preserving the ground state energy exactly.
    • The stablizers are chosen to be an independent generating set of a Hamiltonian symmetry.
  • CS_VQE

    • Performs Contextual-Subspace VQE, allowing one to specify precisely how many qubits they would like in the output Hamiltonian. Despite this process incurring some systematic error, it is possible to retain sufficient information to permit high precision simulations at a significant reduction in quantum resource. This is the updated approach to ContextualSubspaceVQE.
    • Here, the stabilizers are taken to be an independent generating set of a sub-Hamiltonian symmetry (defined by a noncontextual subset of terms) with an additional contribution encapsulating the remaining anticommuting terms therein.

Performance

Why should you use Symmer? It has been designed for high efficiency when manipulating large Pauli operators -- addition, multiplication, Clifford/general rotations, commutativity/contextuality checks, symmetry basis identification, basis reconstruction and subspace projections have all been reformulated in the symplectic representation and implemented carefully to avoid unnecessary operations and redundancy. But don't just take our word for it, see these benchmarks against various popular quantum computing packages:

Single Pauli Multiplication Squaring Linear Combinations
Runtime for phased multiplication of single Pauli operators $P,Q \in \mathcal{P}_N$ with $N \leq 10^8$. Symmer and Qiskit are comparable throughout, with the latter slightly favourable for large numbers of qubits; Stim excels here as it is highly optimized for such operations. Squaring 100-qubit Pauli operators with increasing numbers of terms. This benchmark is particularly challenging as it probes the efficiency of multiplication, addition and the subsequent collection of like-terms.
Clifford Rotations General Rotations
Clifford rotation of 100-qubit Pauli operators with increasing numbers of terms; this tests commutativity checks and multiplication. Symmer has been optimized with this in mind since it is one of the core operations necessary for stabilizer subspace projection techniques. General (non-Clifford) rotations of 100-qubit Pauli operators with increasing numbers of terms; this tests commutativity checks and multiplication, as well as addition and the subsequent cleanup operation. This is relevant for performing unitary partitioning in CS-VQE.

To conclude, what can Symmer do on a standard i5 laptop in just one second?

  • Multiply two 100,000,000-qubit Pauli terms together.
  • Square a 100-qubit Pauli operator with 1,000 terms, involving a cleanup procedure over 1,000,000 cross terms.
  • Perform a unitary rotation of a 100-qubit Pauli operator with 1,000,000 terms.

All this allows us to approach significantly larger systems than was previously possible, including those exceeding the realm of classical tractibility.

How to cite

When you use in a publication or other work, please cite as:

William M. Kirby, Andrew Tranter, and Peter J. Love, Contextual Subspace Variational Quantum Eigensolver, Quantum 5, 456 (2021). Tim J. Weaving, Alexis Ralli, William M. Kirby, Andrew Tranter, Peter J. Love, and Peter V. Coveney, A stabilizer framework for Contextual Subspace VQE and the noncontextual projection ansatz, arxiv preprint (2022), arxiv:2204.02150. Alexis Ralli, Tim Weaving, Andrew Tranter, William M. Kirby, Peter J. Love, and Peter V. Coveney, Unitary Partitioning and the Contextual Subspace Variational Quantum Eigensolver, arxiv preprint (2022), arxiv:2207.03451.

About

Python package to reduce the qubit requirements of quantum simulation via qubit tapering and/or mapping the problem to a contextual subspace

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%