diff --git a/symmer/projection/__init__.py b/symmer/projection/__init__.py index 1790f83f..edac9846 100644 --- a/symmer/projection/__init__.py +++ b/symmer/projection/__init__.py @@ -1,6 +1,6 @@ """init for projection.""" from .utils import * -from .base import S3_projection +from .base import S3Projection from .qubit_tapering import QubitTapering from .contextual_subspace import ContextualSubspace from .qubit_subspace_manager import QubitSubspaceManager \ No newline at end of file diff --git a/symmer/projection/base.py b/symmer/projection/base.py index f0943337..3a7bdc05 100644 --- a/symmer/projection/base.py +++ b/symmer/projection/base.py @@ -4,7 +4,7 @@ from symmer.evolution import trotter, Had from functools import reduce -class S3_projection: +class S3Projection: """ Base class for enabling qubit reduction techniques derived from the Stabilizer SubSpace (S3) projection framework, such as tapering diff --git a/symmer/projection/contextual_subspace.py b/symmer/projection/contextual_subspace.py index f191cc82..51f9733f 100644 --- a/symmer/projection/contextual_subspace.py +++ b/symmer/projection/contextual_subspace.py @@ -4,11 +4,11 @@ update_eigenvalues, StabilizerIdentification, ObservableBiasing, stabilizer_walk, # get_noncon_generators_from_commuting_stabilizers ) -from symmer.projection import S3_projection +from symmer.projection import S3Projection from symmer.evolution import trotter from typing import List, Union, Optional -class ContextualSubspace(S3_projection): +class ContextualSubspace(S3Projection): """ Class for performing contextual subspace methods as per https://quantum-journal.org/papers/q-2021-05-14-456/. Reduces the number of qubits in the problem while aiming to control the systematic error incurred along the way. @@ -21,7 +21,7 @@ class ContextualSubspace(S3_projection): NOTE: the order in which (1) and (2) are performed depends on the noncontextual strategy specified 3. Apply unitary partitioning (either sequence of rotations or linear combination of unitaries) to collapse noncontextual cliques - The remaining steps are handled by the parent S3_projection class: + The remaining steps are handled by the parent S3Projection class: 4. rotate each stabilizer onto a single-qubit Pauli operator, 5. drop the corresponding qubits from the Hamiltonian whilst 6. fixing the +/-1 eigenvalues @@ -320,7 +320,7 @@ def project_onto_subspace(self, operator_to_project:PauliwordOp=None) -> Pauliwo # if there are no stabilizers, return the input operator if self.stabilizers is None: return operator_to_project - # instantiate the parent S3_projection class that handles the subspace projection + # instantiate the parent S3Projection class that handles the subspace projection super().__init__(self.stabilizers) self.S3_initialized = True # perform unitary partitioning diff --git a/symmer/projection/qubit_tapering.py b/symmer/projection/qubit_tapering.py index 011dfd40..f6e68da8 100644 --- a/symmer/projection/qubit_tapering.py +++ b/symmer/projection/qubit_tapering.py @@ -3,10 +3,10 @@ import numpy as np from typing import List, Union from cached_property import cached_property -from symmer.projection import S3_projection +from symmer.projection import S3Projection from symmer.operators import PauliwordOp, IndependentOp, QuantumState -class QubitTapering(S3_projection): +class QubitTapering(S3Projection): """ Class for performing qubit tapering as per https://arxiv.org/abs/1701.08213. Reduces the number of qubits in the problem whilst preserving its energy spectrum by: @@ -17,7 +17,7 @@ class QubitTapering(S3_projection): 4. dropping the corresponding qubits from the Hamiltonian whilst 5. fixing the +/-1 eigenvalues - Steps 1-2 are handled in this class whereas we defer to the parent S3_projection for 3-5. + Steps 1-2 are handled in this class whereas we defer to the parent S3Projection for 3-5. """ def __init__(self, operator: PauliwordOp, @@ -57,7 +57,7 @@ def taper_it(self, """ Finally, once the symmetry generators and sector have been identified, we may perform a projection onto the corresponding stabilizer subspace via - the parent S3_projection class. + the parent S3Projection class. This method allows one to input an auxiliary operator other than the internal operator itself to be tapered consistently with the identified symmetry. This is @@ -90,7 +90,7 @@ def taper_it(self, else: operator_to_taper = self.operator.copy() - # taper the operator via S3_projection.perform_projection + # taper the operator via S3Projection.perform_projection tapered_operator = self.perform_projection( operator=operator_to_taper, ref_state=ref_state,