Skip to content

Commit

Permalink
Renamed S3_projection -> S3Projection
Browse files Browse the repository at this point in the history
  • Loading branch information
TimWeaving committed Nov 28, 2023
1 parent 872b67d commit 4c877cc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion symmer/projection/__init__.py
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion symmer/projection/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions symmer/projection/contextual_subspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions symmer/projection/qubit_tapering.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 4c877cc

Please sign in to comment.