DihedralUtils

class DihedralUtils(num_qubits=2, group_tables=None, elmnt=None, gatelist=None, elmnt_key=None)[source]

Class for util functions for the CNOT-dihedral group.

Parameters
  • num_qubits (int) – number of qubits, dimension of the CNOT-dihedral object.

  • group_tables (dict) – table of all CNOTDihedral objects of a given dimension.

  • elmnt (CNOTDihedral) – a CNOT-dihedral group element.

  • elmnt_key (str) – a unique key of a CNOTDihedral object.

  • gatelist (list) – a list of gates corresponding to a CNOTDihedral object.

Methods

DihedralUtils.cnot_dihedral_gates(idx, …)

Make a single CNOT-dihedral element on num_qubits.

DihedralUtils.cnot_dihedral_tables(num_qubits)

Generate a table of all CNOT-dihedral group elements on num_qubits.

DihedralUtils.compose_gates(elem, next_elem)

Compose two CNOTDihedral objects.

DihedralUtils.elem_to_gates(circ)

Convert a CNOT-dihedral list of gates for the QuantumCircuit.

DihedralUtils.elmnt()

Return a CNOTDihedral object.

DihedralUtils.elmnt_key()

Return a unique key of a CNOTDihedral object.

DihedralUtils.find_inverse_gates(num_qubits, …)

Find the inverse of a CNOT-dihedral element.

DihedralUtils.find_key(elem, num_qubits)

Find the key of a CNOTDihedral object in the group table.

DihedralUtils.gatelist()

Return a list of gates corresponding to a CNOTDihedral object.

DihedralUtils.group_tables()

Return the CNOT-dihedral group tables.

DihedralUtils.load_dihedral_table([picklefile])

Load pickled files of the CNOT-dihedral group tables.

DihedralUtils.load_tables(num_qubits)

Return the CNOT dihedral group tables.

DihedralUtils.num_qubits()

Return the number of qubits of the CNOTDihedral object.

DihedralUtils.pickle_dihedral_table([num_qubits])

Create pickled versions of the CNOT-dihedral group tables.

DihedralUtils.random_gates(num_qubits)

Pick a random CNOT-dihedral element on num_qubits.