![]() |
Tableau representation of a stabilizer state
Inherits From: StabilizerState
cirq.CliffordTableau(
num_qubits, initial_state: int = 0
)
(based on Aaronson and Gottesman 2006).
The tableau stores the stabilizer generators of the state using three binary arrays: xs, zs, and rs.
Each row of the arrays represents a Pauli string, P, that is an eigenoperator of the state vector with eigenvalue one: P|psi> = |psi>.
Args | |
---|---|
num_qubits
|
The number of qubits in the system. |
initial_state
|
The computational basis representation of the state as a big endian int. |
Attributes | |
---|---|
rs
|
|
xs
|
|
zs
|
Methods
apply_cx
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
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
apply_global_phase(
coefficient: linear_dict.Scalar
)
Apply a global phase to the state.
Args | |
---|---|
coefficient
|
The global phase to apply. |
apply_h
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
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
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
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. |
copy
copy() -> 'CliffordTableau'
destabilizers
destabilizers() -> List['cirq.DensePauliString']
Returns the destabilizer generators of the state. These are n operators {S_1,S_2,...,S_n} such that along with the stabilizer generators above generate the full Pauli group on n qubits.
inverse
inverse() -> 'CliffordTableau'
Returns the inverse Clifford tableau of this tableau.
matrix
matrix() -> np.array
Returns the 2n * 2n matrix representation of the Clifford tableau.
stabilizers
stabilizers() -> List['cirq.DensePauliString']
Returns the stabilizer generators of the state. These are n operators {S_1,S_2,...,S_n} such that S_i |psi> = |psi>
then
then(
second: 'CliffordTableau'
) -> 'CliffordTableau'
Returns a composed CliffordTableau of this tableau and the second tableau.
Then composed tableau is equal to (up to global phase) the composed unitary operation of the two tableaux, i.e. equivalent to applying the unitary operation of this CliffordTableau then applying the second one.
Args | |
---|---|
second
|
The second CliffordTableau to compose with. |
Returns | |
---|---|
The composed CliffordTableau. |
Raises | |
---|---|
TypeError
|
If the type of second is not CliffordTableau. |
ValueError
|
If the number of qubits in the second tableau mismatch with this tableau. |
__eq__
__eq__(
other
)
Return self==value.
__matmul__
__matmul__(
second: 'CliffordTableau'
)