pyqrack.qrack_ace_backend

Attributes

_IS_QISKIT_AVAILABLE

_IS_QISKIT_AVAILABLE

_IS_QISKIT_AER_AVAILABLE

_IS_QISKIT_AER_AVAILABLE

Classes

LHVQubit

QrackAceBackend

A back end for elided quantum error correction

Functions

_cpauli_lhv(prob, targ, axis, anti[, theta])

Apply a 'soft' controlled-Pauli gate: rotate target qubit

Module Contents

pyqrack.qrack_ace_backend._IS_QISKIT_AVAILABLE = True
pyqrack.qrack_ace_backend._IS_QISKIT_AVAILABLE = False
pyqrack.qrack_ace_backend._IS_QISKIT_AER_AVAILABLE = True
pyqrack.qrack_ace_backend._IS_QISKIT_AER_AVAILABLE = False
class pyqrack.qrack_ace_backend.LHVQubit(to_clone=None)
reset()
h()
x()
y()
z()
rx(theta)
ry(theta)
rz(theta)
s()
adjs()
t()
adjt()
u(theta, phi, lam)
mtrx(matrix)

Apply a 2x2 unitary matrix to the LHV Bloch vector using only standard math/cmath. Matrix format: [a, b, c, d] for [[a, b], [c, d]]

prob(basis=Pauli.PauliZ)

Sample a classical outcome from the current ‘quantum’ state

m()
pyqrack.qrack_ace_backend._cpauli_lhv(prob, targ, axis, anti, theta=math.pi)

Apply a ‘soft’ controlled-Pauli gate: rotate target qubit proportionally to control’s Z expectation value.

theta: full rotation angle if control in |1⟩

class pyqrack.qrack_ace_backend.QrackAceBackend(qubit_count=1, long_range_columns=4, long_range_rows=4, is_transpose=False, is_schmidt_decompose_multi=False, is_stabilizer_hybrid=False, is_binary_decision_tree=False, is_gpu=True, is_host_pointer=True if os.environ.get('PYQRACK_HOST_POINTER_DEFAULT_ON') else False, is_near_clifford_tableau_writer=False, noise=0, to_clone=None)

A back end for elided quantum error correction

This back end uses elided repetition code on a nearest-neighbor topology to emulate a utility-scale superconducting chip quantum computer in very little memory.4

The backend was originally designed assuming an (orbifolded) 2D qubit grid like 2019 Sycamore. However, it quickly became apparent that users can basically design their own connectivity topologies, without breaking the concept. (Not all will work equally well.)

Consider distributing the different “patches” to different GPUs with self.sim[sim_id].set_device(gpu_id)! (If you have 3+ patches, maybe your discrete GPU can do multiple patches in the time it takes an Intel HD to do one patch worth of work!)

sim

Array of simulators corresponding to “patches” between boundary rows.

Type:

QrackSimulator

long_range_columns

How many ideal rows between QEC boundary rows?

Type:

int

is_transpose

Rows are long if False, columns are long if True

Type:

bool

long_range_columns = 4
long_range_rows = 4
is_transpose = False
_coupling_map = None
_qubits = []
sim = []
clone()
num_qubits()
get_row_length()
get_column_length()
_factor_width(width, is_transpose=False)
_ct_pair_prob(q1, q2)
_cz_shadow(q1, q2)
_qec_x(c)
_qec_h(t)
_qec_s(t)
_qec_adjs(t)
_anti_cz_shadow(c, t)
_cx_shadow(c, t)
_anti_cx_shadow(c, t)
_cy_shadow(c, t)
_anti_cy_shadow(c, t)
_unpack(lq)
static _get_qb_lhv_indices(hq)
static _get_lhv_bloch_angles(sim)
_get_bloch_angles(hq)
_rotate_to_bloch(hq, delta_azimuth, delta_inclination)
static _rotate_lhv_to_bloch(sim, delta_azimuth, delta_inclination)
_correct(lq, phase=False, skip_rotation=False)
apply_magnetic_bias(q, b)
u(lq, th, ph, lm)
r(p, th, lq)
h(lq)
s(lq)
adjs(lq)
x(lq)
y(lq)
z(lq)
t(lq)
adjt(lq)
_get_gate(pauli, anti, sim_id)
_get_connected(i, is_row)
_apply_coupling(pauli, anti, qb1, lhv1, hq1, qb2, lhv2, hq2, lq1_lr)
_cpauli(lq1, lq2, anti, pauli)
cx(lq1, lq2)
cy(lq1, lq2)
cz(lq1, lq2)
acx(lq1, lq2)
acy(lq1, lq2)
acz(lq1, lq2)
mcx(lq1, lq2)
mcy(lq1, lq2)
mcz(lq1, lq2)
macx(lq1, lq2)
macy(lq1, lq2)
macz(lq1, lq2)
swap(lq1, lq2)
iswap(lq1, lq2)
adjiswap(lq1, lq2)
prob(lq)
m(lq)
force_m(lq, result)
m_all()
measure_shots(q, s)
_apply_op(operation)
_add_sample_measure(sample_qubits, sample_clbits, num_samples)

Generate data samples from current statevector.

Taken almost straight from the terra source code.

Parameters:
  • measure_params (list) – List of (qubit, clbit) values for measure instructions to sample.

  • num_samples (int) – The number of data samples to generate.

Returns:

A list of data values in hex format.

Return type:

list

run_qiskit_circuit(experiment, shots=1)
static get_qiskit_basis_gates()
get_logical_coupling_map()
create_noise_model(x=0.25, y=0.25)