CliffordUtils¶
- class CliffordUtils(num_qubits=2, group_tables=None, elmnt=None, gatelist=None, elmnt_key=None)[source]¶
Class for util functions for the Clifford group.
- Parameters
num_qubits (int) – number of qubits, dimension of the Clifford object.
group_tables (dict) – table of all the Clifford objects of a given dimension.
elmnt (Clifford) – a Clifford group element.
elmnt_key (str) – a unique index of a Clifford object.
gatelist (list) – a list of gates corresponding to a Clifford object.
Methods
Make a single qubit Clifford gate.
Generate a table of all 1-qubit Clifford gates.
Make a 2-qubit Clifford gate.
Generate a table of all 2-qubit Clifford gates.
Generate a Clifford object from a list of gates.
CliffordUtils.compose_gates
(cliff, gatelist)Add gates to a Clifford object from a list of gates.
CliffordUtils.cx_gates
(gatelist, ctrl, tgt)Adds a controlled-x gate on qubits ctrl and tgt to a given list of gates.
Return a Clifford object.
Return a unique index of a Clifford object.
CliffordUtils.find_inverse_gates
(num_qubits, …)Find the inverse of a Clifford gate.
CliffordUtils.find_key
(cliff, num_qubits)Find the Clifford index.
Return a list of gates corresponding to a Clifford object.
Return the Clifford group tables.
CliffordUtils.h_gates
(gatelist, q, h)Append a hadamard gate on qubit q to a given list of gates.
CliffordUtils.load_clifford_table
([picklefile])Load pickled files of the tables of 1 and 2 qubit Clifford group tables.
CliffordUtils.load_tables
(num_qubits)Return the Clifford group tables.
Return the number of qubits of the Clifford object.
CliffordUtils.pauli_gates
(gatelist, q, pauli)Append a pauli gate on qubit q to a given list of gates.
Create pickled versions of the 1 or 2 qubit Clifford group tables.
CliffordUtils.random_gates
(num_qubits[, …])Pick a random Clifford gate on num_qubits.
CliffordUtils.v_gates
(gatelist, q, v)Adds an axis-swap gate V or W on qubit q to a given list of gates.