Interface for quantum stabilizer state representations.
This interface is used for CliffordTableau and StabilizerChForm quantum
state representations, allowing simulators to act on them abstractly.
Methods
apply_cx
View source
@abc.abstractmethod
apply_cx(
control_axis: int,
target_axis: int,
exponent: float = 1,
global_shift: float = 0
)
Apply a CX operation to the state.
Args |
control_axis
|
The control axis of the operation.
|
target_axis
|
The axis to which the operation should be applied.
|
exponent
|
The exponent of the CX operation, must be an integer.
|
global_shift
|
The global phase shift of the raw operation, prior to
exponentiation. Typically the value in gate.global_shift .
|
Raises |
ValueError
|
If the exponent is not an integer.
|
apply_cz
View source
@abc.abstractmethod
apply_cz(
control_axis: int,
target_axis: int,
exponent: float = 1,
global_shift: float = 0
)
Apply a CZ operation to the state.
Args |
control_axis
|
The control axis of the operation.
|
target_axis
|
The axis to which the operation should be applied.
|
exponent
|
The exponent of the CZ operation, must be an integer.
|
global_shift
|
The global phase shift of the raw operation, prior to
exponentiation. Typically the value in gate.global_shift .
|
Raises |
ValueError
|
If the exponent is not an integer.
|
apply_global_phase
View source
@abc.abstractmethod
apply_global_phase(
coefficient: linear_dict.Scalar
)
Apply a global phase to the state.
Args |
coefficient
|
The global phase to apply.
|
apply_h
View source
@abc.abstractmethod
apply_h(
axis: int, exponent: float = 1, global_shift: float = 0
)
Apply an H operation to the state.
Args |
axis
|
The axis to which the operation should be applied.
|
exponent
|
The exponent of the H operation, must be an integer.
|
global_shift
|
The global phase shift of the raw operation, prior to
exponentiation. Typically the value in gate.global_shift .
|
Raises |
ValueError
|
If the exponent is not an integer.
|
apply_x
View source
@abc.abstractmethod
apply_x(
axis: int, exponent: float = 1, global_shift: float = 0
)
Apply an X operation to the state.
Args |
axis
|
The axis to which the operation should be applied.
|
exponent
|
The exponent of the X operation, must be a half-integer.
|
global_shift
|
The global phase shift of the raw operation, prior to
exponentiation. Typically the value in gate.global_shift .
|
Raises |
ValueError
|
If the exponent is not half-integer.
|
apply_y
View source
@abc.abstractmethod
apply_y(
axis: int, exponent: float = 1, global_shift: float = 0
)
Apply an Y operation to the state.
Args |
axis
|
The axis to which the operation should be applied.
|
exponent
|
The exponent of the Y operation, must be a half-integer.
|
global_shift
|
The global phase shift of the raw operation, prior to
exponentiation. Typically the value in gate.global_shift .
|
Raises |
ValueError
|
If the exponent is not half-integer.
|
apply_z
View source
@abc.abstractmethod
apply_z(
axis: int, exponent: float = 1, global_shift: float = 0
)
Apply a Z operation to the state.
Args |
axis
|
The axis to which the operation should be applied.
|
exponent
|
The exponent of the Z operation, must be a half-integer.
|
global_shift
|
The global phase shift of the raw operation, prior to
exponentiation. Typically the value in gate.global_shift .
|
Raises |
ValueError
|
If the exponent is not half-integer.
|