cutqc2.library.Supremacy package

Submodules

cutqc2.library.Supremacy.ABCD_layer_generation module

cutqc2.library.Supremacy.ABCD_layer_generation.get_layers(n, m)[source]

With the given n, m denoting a (n x m) matrix, return the corresponding A, B, C, and D layers of 2qb-gates that will enact a two qubit interaction between each pair of neighbors.

A, B, C, and D layers are defined in Google’s Supp. Info: (https://www.nature.com/articles/s41586-019-1666-5#Sec9)

cutqc2.library.Supremacy.ABCD_layer_generation.get_pattern_A(n, m)[source]
cutqc2.library.Supremacy.ABCD_layer_generation.get_pattern_B(n, m)[source]
cutqc2.library.Supremacy.ABCD_layer_generation.get_pattern_C(n, m)[source]
cutqc2.library.Supremacy.ABCD_layer_generation.get_pattern_D(n, m)[source]
cutqc2.library.Supremacy.ABCD_layer_generation.get_row_major(n, m, loc)[source]
cutqc2.library.Supremacy.ABCD_layer_generation.main()[source]

cutqc2.library.Supremacy.Qbit_Sycamore module

class cutqc2.library.Supremacy.Qbit_Sycamore.Qbit(index, prev_1q_gate)[source]

Bases: object

random_gate()[source]

cutqc2.library.Supremacy.Qbit_original module

class cutqc2.library.Supremacy.Qbit_original.Qbit(index, prev_1q_gate)[source]

Bases: object

h()[source]
random_gate()[source]

cutqc2.library.Supremacy.Qgrid_Sycamore module

class cutqc2.library.Supremacy.Qgrid_Sycamore.Qgrid(n, m, d, order=None, singlegates=True, barriers=True, measure=False, regname=None)[source]

Bases: object

Class to implement the quantum supremacy circuits as found in Arute, F., Arya, K., Babbush, R. et al. ‘Quantum supremacy using a programmable superconducting processor’. Nature 574, 505–510 (2019) doi:10.1038/s41586-019-1666-5

(https://www.nature.com/articles/s41586-019-1666-5)

Each instance is a 2D array whose entries at Qbit objects. A supremacy circuit can be generated for a given instance by calling the gen_circuit() method.

n

number of rows in the grid

Type:

int

m

number of columns in the grid

Type:

int

d

depth of the supremacy circuit (excludes measurement i.e. d+1)

Type:

int

regname

optional string to name the quantum and classical registers. This allows for the easy concatenation of multiple QuantumCircuits.

Type:

str

qreg

Qiskit QuantumRegister holding all of the qubits

Type:

QuantumRegister

creg

Qiskit ClassicalRegister holding all of the classical bits

Type:

ClassicalRegister

circ

Qiskit QuantumCircuit that represents the supremacy circuit

Type:

QuantumCircuit

grid

n x m array holding Qbit objects

Type:

array

ABCD_layers

List of qubit indices for 2-qubit gates for the A, B, C, and D layers of the supremacy circuit.

Type:

list

order

list of indices indicting the order the cz layers should be placed

Type:

list

singlegates

Boolean indicating whether to include single qubit gates in the circuit

Type:

bool

apply_random_1q_gate(n, m)[source]
gen_circuit()[source]
gen_qasm()[source]
get_index(index1=None, index2=None)[source]
make_grid(n, m)[source]
measure_circuit()[source]
print_circuit()[source]
save_circuit()[source]

cutqc2.library.Supremacy.Qgrid_original module

class cutqc2.library.Supremacy.Qgrid_original.Qgrid(n, m, d, order=None, singlegates=True, mirror=True, barriers=True, measure=False, regname=None)[source]

Bases: object

Class to implement the quantum supremacy circuits as found in https://www.nature.com/articles/s41567-018-0124-x and https://github.com/sboixo/GRCS. Each instance is a 2D array whose entries at Qbit objects. A supremacy circuit can be generated for a given instance by calling the gen_circuit() method.

n

number of rows in the grid

Type:

int

m

number of columns in the grid

Type:

int

d

depth of the supremacy circuit (excludes H-layer and measurement i.e. 1+d+1)

Type:

int

regname

optional string to name the quantum and classical registers. This allows for the easy concatenation of multiple QuantumCircuits.

Type:

str

qreg

Qiskit QuantumRegister holding all of the qubits

Type:

QuantumRegister

creg

Qiskit ClassicalRegister holding all of the classical bits

Type:

ClassicalRegister

circ

Qiskit QuantumCircuit that represents the supremacy circuit

Type:

QuantumCircuit

grid

n x m array holding Qbit objects

Type:

array

cz_list

List of the CZ-gate indices for each layer of the supremacy circuit

Type:

list

mirror

Boolean indicating whether the cz layers should repeat exactly or in reverse order

Type:

bool

order

list of indices indicting the order the cz layers should be placed

Type:

list

singlegates

Boolean indicating whether to include single qubit gates in the circuit

Type:

bool

apply_T(grid_loc, reserved_qubits)[source]

Apply a T gate on the specified qubit if it is not currently involved in a CZ gate

grid_loc = [row_idx, col_idx]

apply_postCZ_gate(grid_loc, reserved_qubits)[source]
gen_circuit()[source]
gen_qasm()[source]
get_index(index1=None, index2=None)[source]
hadamard_layer()[source]
make_grid(n, m)[source]
measure_circuit()[source]
print_circuit()[source]
save_circuit()[source]

cutqc2.library.Supremacy.cz_layer_generation module

cutqc2.library.Supremacy.cz_layer_generation.cz_layer(nrow, ncol, starting_idx)[source]
cutqc2.library.Supremacy.cz_layer_generation.get_layers(n, m)[source]

With the given n, m denoting a (n x m) matrix, return the corresponding layers of CZ gates that will enact a two qubit interaction between each pair of neighbors.

cutqc2.library.Supremacy.cz_layer_generation.get_row_major(n, m, loc)[source]
cutqc2.library.Supremacy.cz_layer_generation.main()[source]

Module contents