surface_sim.models.Model#

class Model(qubit_inds, setup=None)[source]#

Noise model class for generating the stim.Circuit for each of the physical operations including noise channels.

IMPORTANT

The noise models assume that operation layers are separated by Model.tick(), and that all qubits participiate in an operation in the opertion layers. Note that Model.idle and Model.idleidle considered an operation, i.e. "I" and "II" respectively, while Model.idle_noise is not.

When designing new noise model classes,

1. the method output should be a stim.Circuit that must include the operation of the corresponding method (e.g. "X" for Model.x_gate) and (optionally) noise channels. It should not include anything else.

2. Model.tick``s do not contain any noise except from the one called by ``Model.flush_noise. Model.flush_noise adds all the “still-not-added” noise from the previous operation layer (this is useful in e.g. T1T2NoiseModel). Note that if Model.tick are followed one after the other, Model.flush_noise is only called for the first one. This is done so that there are no issues when merging operation layers and because TICKs are just annotations, not noise. If noise wants to be present between TICKs, then idling gates must be added.

For more information, read the comments in issue #232.

__init__(qubit_inds, setup=None)[source]#

Methods

add_meas(qubit)

Adds a measurement record for the specified qubit.

c_nxyz_gate(qubits)

c_nzyx_gate(qubits)

c_xnyz_gate(qubits)

c_xynz_gate(qubits)

c_xyz_gate(qubits)

c_znyx_gate(qubits)

c_zynx_gate(qubits)

c_zyx_gate(qubits)

cnot(qubits)

cphase(qubits)

cx(qubits)

cxswap(qubits)

cy(qubits)

cz(qubits)

czswap(qubits)

flush_noise()

from_layouts(*layouts[, setup])

Creates a Model object using the information from the layouts.

gate_duration(name)

get_inds(qubits)

h_gate(qubits)

h_nxy_gate(qubits)

h_nxz_gate(qubits)

h_nyz_gate(qubits)

h_xy_gate(qubits)

h_xz_gate(qubits)

h_yz_gate(qubits)

hadamard(qubits)

idle(qubits)

idle_noise(qubits)

idleidle(qubits)

incoming_noise(qubits)

iswap(qubits)

iswap_dag(qubits)

load_state(filename)

Loads the state inside the given YAML file.

meas_target(qubit, rel_meas_ind)

Returns the global measurement index for stim.target_rec for the specified qubit and its relative measurement index (for the given qubit).

measure(qubits)

measure_x(qubits)

measure_y(qubits)

measure_z(qubits)

new_circuit()

Empties the variables used for meas_target.

param(*args, **kargs)

qubit_coords(coords)

reset(qubits)

reset_x(qubits)

reset_y(qubits)

reset_z(qubits)

s_dag_gate(qubits)

s_gate(qubits)

sqrt_x_dag_gate(qubits)

sqrt_x_gate(qubits)

sqrt_xx(qubits)

sqrt_xx_dag(qubits)

sqrt_y_dag_gate(qubits)

sqrt_y_gate(qubits)

sqrt_yy(qubits)

sqrt_yy_dag(qubits)

sqrt_z_dag_gate(qubits)

sqrt_z_gate(qubits)

sqrt_zz(qubits)

sqrt_zz_dag(qubits)

store_state(filename)

Stores the current state to the given YAML file.

swap(qubits)

swapcx(qubits)

swapcz(qubits)

tick()

x_gate(qubits)

xcx(qubits)

xcy(qubits)

xcz(qubits)

ycx(qubits)

ycy(qubits)

ycz(qubits)

z_gate(qubits)

zcx(qubits)

zcy(qubits)

zcz(qubits)

Attributes

__init__(qubit_inds[, setup])

add_meas(qubit)

Adds a measurement record for the specified qubit.

c_nxyz_gate(qubits)

c_nzyx_gate(qubits)

c_xnyz_gate(qubits)

c_xynz_gate(qubits)

c_xyz_gate(qubits)

c_znyx_gate(qubits)

c_zynx_gate(qubits)

c_zyx_gate(qubits)

cnot(qubits)

cphase(qubits)

cx(qubits)

cxswap(qubits)

cy(qubits)

cz(qubits)

czswap(qubits)

flush_noise()

from_layouts(*layouts[, setup])

Creates a Model object using the information from the layouts.

gate_duration(name)

get_inds(qubits)

h_gate(qubits)

h_nxy_gate(qubits)

h_nxz_gate(qubits)

h_nyz_gate(qubits)

h_xy_gate(qubits)

h_xz_gate(qubits)

h_yz_gate(qubits)

hadamard(qubits)

idle(qubits)

idle_noise(qubits)

idleidle(qubits)

incoming_noise(qubits)

iswap(qubits)

iswap_dag(qubits)

load_state(filename)

Loads the state inside the given YAML file.

meas_target(qubit, rel_meas_ind)

Returns the global measurement index for stim.target_rec for the specified qubit and its relative measurement index (for the given qubit).

measure(qubits)

measure_x(qubits)

measure_y(qubits)

measure_z(qubits)

new_circuit()

Empties the variables used for meas_target.

param(*args, **kargs)

qubit_coords(coords)

reset(qubits)

reset_x(qubits)

reset_y(qubits)

reset_z(qubits)

s_dag_gate(qubits)

s_gate(qubits)

sqrt_x_dag_gate(qubits)

sqrt_x_gate(qubits)

sqrt_xx(qubits)

sqrt_xx_dag(qubits)

sqrt_y_dag_gate(qubits)

sqrt_y_gate(qubits)

sqrt_yy(qubits)

sqrt_yy_dag(qubits)

sqrt_z_dag_gate(qubits)

sqrt_z_gate(qubits)

sqrt_zz(qubits)

sqrt_zz_dag(qubits)

store_state(filename)

Stores the current state to the given YAML file.

swap(qubits)

swapcx(qubits)

swapcz(qubits)

tick()

x_gate(qubits)

xcx(qubits)

xcy(qubits)

xcz(qubits)

ycx(qubits)

ycy(qubits)

ycz(qubits)

z_gate(qubits)

zcx(qubits)

zcy(qubits)

zcz(qubits)