Skip to content

clifford_group

tergite_autocalibration.lib.nodes.coupler.tqg_randomized_benchmarking.utils.clifford_group

Classes:

Name Description
Clifford

Base class for Clifford

SingleQubitClifford

Single Qubit Clifford gate class

TwoQubitClifford

Two Qubit Clifford gate class

Clifford

Clifford(idx: int)

Base class for Clifford

Abstract base class for all Clifford operations.

Attributes:

Name Type Description
idx int

Index of the Clifford operation

GROUP_SIZE ClassVar[int]

Size of the Clifford group

CLIFFORD_HASH_TABLE CLassVar[Dict[int, int]]

Hash table for fast lookup of Clifford indices

Initialize the Clifford object with a given index

Parameters:

Name Type Description Default
idx int

Index of the Clifford operation

required

Attributes:

Name Type Description
idx int

Index of the Clifford operation

Raises:

Type Description
ValueError

If the index is not valid (0 <= idx < GROUP_SIZE)

Methods:

Name Description
find_clifford_index

Find the index of a Clifford matrix using hash lookup

get_inverse

Get the inverse of this Clifford operation

gate_decomposition property

gate_decomposition: List[Tuple[List[str], str]]

Returns the gate decomposition of the Clifford gate

Returns:

Name Type Description
List List[Tuple[List[str], str]]

Gate decomposition as a list of tuples (gate_name, qubit_identifier)

pauli_transfer_matrix property

pauli_transfer_matrix: ndarray

Returns the Pauli transfer matrix of the Clifford operation.

Returns:

Type Description
ndarray

np.ndarray: The Pauli transfer matrix

find_clifford_index classmethod

find_clifford_index(matrix: ndarray) -> int

Find the index of a Clifford matrix using hash lookup

Parameters:

Name Type Description Default
matrix ndarray

The Pauli transfer matrix

required

Returns:

Name Type Description
int int

The index of the Clifford operation

Raises:

Type Description
ValueError

If the Clifford index is not found

get_inverse

get_inverse() -> Clifford

Get the inverse of this Clifford operation

Returns:

Name Type Description
Clifford Clifford

The inverse operation

SingleQubitClifford

SingleQubitClifford(idx: int)

Bases: Clifford

Single Qubit Clifford gate class

The decomposition of the single qubit clifford group follows paper Epstein et al. Phys. Rev. A 89, 062321 (2014)

Initialize the Clifford object with a given index

Parameters:

Name Type Description Default
idx int

Index of the Clifford operation

required

Attributes:

Name Type Description
idx int

Index of the Clifford operation

Raises:

Type Description
ValueError

If the index is not valid (0 <= idx < GROUP_SIZE)

Methods:

Name Description
find_clifford_index

Find the index of a Clifford matrix using hash lookup

get_inverse

Get the inverse of this Clifford operation

Attributes:

Name Type Description
gate_decomposition List[Tuple[List[str], str]]

Returns the gate decomposition of the single qubit Clifford group

pauli_transfer_matrix ndarray

Returns the Pauli transfer matrix of the single qubit Clifford operation

gate_decomposition property

gate_decomposition: List[Tuple[List[str], str]]

Returns the gate decomposition of the single qubit Clifford group according to the decomposition by Epstein et al.

Returns:

Type Description
List[Tuple[List[str], str]]

List of tuples where each tuple contains (gate_name, qubit_identifier)

pauli_transfer_matrix property

pauli_transfer_matrix: ndarray

Returns the Pauli transfer matrix of the single qubit Clifford operation

find_clifford_index classmethod

find_clifford_index(matrix: ndarray) -> int

Find the index of a Clifford matrix using hash lookup

Parameters:

Name Type Description Default
matrix ndarray

The Pauli transfer matrix

required

Returns:

Name Type Description
int int

The index of the Clifford operation

Raises:

Type Description
ValueError

If the Clifford index is not found

get_inverse

get_inverse() -> Clifford

Get the inverse of this Clifford operation

Returns:

Name Type Description
Clifford Clifford

The inverse operation

TwoQubitClifford

TwoQubitClifford(idx: int)

Bases: Clifford

Two Qubit Clifford gate class

The Clifford decomposition closely follows two papers:

  1. Corcoles et al. Process verification ... Phys. Rev. A. 2013 http://journals.aps.org/pra/pdf/10.1103/PhysRevA.87.030301 for the different classes of two-qubit Cliffords.

  2. Barends et al. Superconducting quantum circuits at the ... Nature 2014 https://www.nature.com/articles/nature13171?lang=en for writing the cliffords in terms of CZ gates.

2-qubit clifford decompositions

The two qubit clifford group (C2) consists of 11520 two-qubit cliffords These gates can be subdivided into four classes. 1. The Single-qubit like class | 576 elements (24^2) 2. The CNOT-like class | 5184 elements (24^2 * 3^2) 3. The iSWAP-like class | 5184 elements (24^2 * 3^2) 4. The SWAP-like class | 576 elements (24^2) --------------------------------|------------- + Two-qubit Clifford group C2 | 11520 elements

  1. The Single-qubit like class -- C1 -- -- C1 --

  2. The CNOT-like class --C1--•--S1-- --C1--•--S1------ | -> | --C1--⊕--S1-- --C1--•--S1^Y90--

  3. The iSWAP-like class --C1----S1-- --C1--•---Y90--•--S1^Y90-- | -> | | --C1----S1-- --C1--•--mY90--•--S1^X90--

  4. The SWAP-like class --C1--x-- --C1--•-mY90--•--Y90--•------- | -> | | | --C1--x-- --C1--•--Y90--•-mY90--•--Y90--

element of the single qubit Clifford group

Note: We use the decomposition defined in Epstein et al. here

S1: element of the S1 group, a subgroup of the single qubit Clifford group

Initialize the Clifford object with a given index

Parameters:

Name Type Description Default
idx int

Index of the Clifford operation

required

Attributes:

Name Type Description
idx int

Index of the Clifford operation

Raises:

Type Description
ValueError

If the index is not valid (0 <= idx < GROUP_SIZE)

Methods:

Name Description
CNOT_like_PTM

Returns the pauli transfer matrix for gates of the cnot like class

CNOT_like_gates

Returns the gates for Cliffords of the cnot like class

SWAP_like_PTM

Returns the pauli transfer matrix for gates of the SWAP like class

SWAP_like_gates

Returns the gates for Cliffords of the SWAP like class

find_clifford_index

Find the index of a Clifford matrix using hash lookup

get_inverse

Get the inverse of this Clifford operation

iSWAP_like_PTM

Returns the pauli transfer matrix for gates of the iSWAP like class

iSWAP_like_gates

Returns the gates for Cliffords of the iSWAP like class

single_qubit_like_PTM

Returns the pauli transfer matrix for gates of the single qubit like class

single_qubit_like_gates

Returns the gates for Cliffords of the single qubit like class

Attributes:

Name Type Description
gate_decomposition

Returns the gate decomposition of the two qubit Clifford group.

gate_decomposition property

gate_decomposition

Returns the gate decomposition of the two qubit Clifford group.

Single qubit Cliffords are decomposed according to Epstein et al.

CNOT_like_PTM classmethod

CNOT_like_PTM(idx: int) -> ndarray

Returns the pauli transfer matrix for gates of the cnot like class (q0) --C1--•--S1-- --C1--•--S1------ | -> | (q1) --C1--⊕--S1-- --C1--•--S1^Y90--

CNOT_like_gates classmethod

CNOT_like_gates(idx: int)

Returns the gates for Cliffords of the cnot like class (q0) --C1--•--S1-- --C1--•--S1------ | -> | (q1) --C1--⊕--S1-- --C1--•--S1^Y90--

SWAP_like_PTM classmethod

SWAP_like_PTM(idx: int) -> ndarray

Returns the pauli transfer matrix for gates of the SWAP like class

(q0) --C1--x-- --C1--•-mY90--•--Y90--•------- | -> | | | (q1) --C1--x-- --C1--•--Y90--•-mY90--•--Y90--

SWAP_like_gates classmethod

SWAP_like_gates(idx: int)

Returns the gates for Cliffords of the SWAP like class

(q0) --C1--x-- --C1--•-mY90--•--Y90--•------- | -> | | | (q1) --C1--x-- --C1--•--Y90--•-mY90--•--Y90--

find_clifford_index classmethod

find_clifford_index(matrix: ndarray) -> int

Find the index of a Clifford matrix using hash lookup

Parameters:

Name Type Description Default
matrix ndarray

The Pauli transfer matrix

required

Returns:

Name Type Description
int int

The index of the Clifford operation

Raises:

Type Description
ValueError

If the Clifford index is not found

get_inverse

get_inverse() -> Clifford

Get the inverse of this Clifford operation

Returns:

Name Type Description
Clifford Clifford

The inverse operation

iSWAP_like_PTM classmethod

iSWAP_like_PTM(idx: int) -> ndarray

Returns the pauli transfer matrix for gates of the iSWAP like class (q0) --C1----S1-- --C1--•---Y90--•--S1^Y90-- | -> | | (q1) --C1----S1-- --C1--•--mY90--•--S1^X90--

iSWAP_like_gates classmethod

iSWAP_like_gates(idx: int)

Returns the gates for Cliffords of the iSWAP like class (q0) --C1----S1-- --C1--•---Y90--•--S1^Y90-- | -> | | (q1) --C1----S1-- --C1--•--mY90--•--S1^X90--

single_qubit_like_PTM classmethod

single_qubit_like_PTM(idx: int) -> ndarray

Returns the pauli transfer matrix for gates of the single qubit like class (q0) -- C1 -- (q1) -- C1 --

single_qubit_like_gates classmethod

single_qubit_like_gates(idx: int) -> List[Tuple[str, str]]

Returns the gates for Cliffords of the single qubit like class (q0) -- C1 -- (q1) -- C1 --