Clifford¶

class
Clifford
(data, validate=True)[source]¶ Bases:
qiskit.quantum_info.operators.base_operator.BaseOperator
,qiskit.quantum_info.operators.mixins.adjoint.AdjointMixin
An Nqubit unitary operator from the Clifford group.
Representation
An Nqubit Clifford operator is stored as a length 2N
StabilizerTable
using the convention from reference [1].Rows 0 to N1 are the destabilizer group generators
Rows N to 2N1 are the stabilizer group generators.
The internal
StabilizerTable
for the Clifford can be accessed using thetable
attribute. The destabilizer or stabilizer rows can each be accessed as a lengthN Stabilizer table usingdestabilizer
andstabilizer
attributes.A more easily human readable representation of the Clifford operator can be obtained by calling the
to_dict()
method. This representation is also used if a Clifford object is printed as in the following examplefrom qiskit import QuantumCircuit from qiskit.quantum_info import Clifford # Bell state generation circuit qc = QuantumCircuit(2) qc.h(0) qc.cx(0, 1) cliff = Clifford(qc) # Print the Clifford print(cliff) # Print the Clifford destabilizer rows print(cliff.destabilizer) # Print the Clifford stabilizer rows print(cliff.stabilizer)
Clifford: Stabilizer = ['+XX', '+ZZ'], Destabilizer = ['+IZ', '+XI'] StabilizerTable: ['+IZ', '+XI'] StabilizerTable: ['+XX', '+ZZ']
Circuit Conversion
Clifford operators can be initialized from circuits containing only the following Clifford gates:
IGate
,XGate
,YGate
,ZGate
,HGate
,SGate
,SdgGate
,CXGate
,CZGate
,SwapGate
. They can be converted back into aQuantumCircuit
, orGate
object using theto_circuit()
orto_instruction()
methods respectively. Note that this decomposition is not necessarily optimal in terms of number of gates.Note
A minimally generating set of gates for Clifford circuits is the
HGate
andSGate
gate and either theCXGate
orCZGate
twoqubit gate.Clifford operators can also be converted to
Operator
objects using theto_operator()
method. This is done via decomposing to a circuit, and then simulating the circuit as a unitary operator.References
S. Aaronson, D. Gottesman, Improved Simulation of Stabilizer Circuits, Phys. Rev. A 70, 052328 (2004). arXiv:quantph/0406196
Initialize an operator object.
Methods
Return the adjoint of the Operator.
Return the operator composition with another Clifford.
Return the conjugate of the Clifford.
Make a deep copy of current operator.
Return the right multiplied operator self * other.
Return the reverseorder tensor product with another Clifford.
Initialize from a QuantumCircuit or Instruction.
Load a Clifford from a dictionary
Return a tensor product of singlequbit Clifford gates.
Return tuple of input dimension for specified subsystems.
Return True if the Clifford table is valid.
Return tuple of output dimension for specified subsystems.
Return the compose of a operator with itself n times.
Return a shallow copy with reshaped input and output subsystem dimensions.
Return the tensor product with another Clifford.
Return a QuantumCircuit implementing the Clifford.
Return dictionary representation of Clifford object.
Return a Gate instruction implementing the Clifford.
Convert operator to Numpy matrix.
Convert to an Operator object.
Return the transpose of the Clifford.
Attributes

destabilizer
¶ Return the destabilizer block of the StabilizerTable.

dim
¶ Return tuple (input_shape, output_shape).

num_qubits
¶ Return the number of qubits if a Nqubit operator or None otherwise.

qargs
¶ Return the qargs for the operator.

stabilizer
¶ Return the stabilizer block of the StabilizerTable.

table
¶ Return StabilizerTable