surface_sim.models.Model#
- class Model(qubit_inds, setup=None)[source]#
Noise model class for generating the
stim.Circuitfor 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 thatModel.idleandModel.idleidleconsidered an operation, i.e."I"and"II"respectively, whileModel.idle_noiseis not.When designing new noise model classes,
1. the method output should be a
stim.Circuitthat must include the operation of the corresponding method (e.g."X"forModel.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_noiseadds all the “still-not-added” noise from the previous operation layer (this is useful in e.g.T1T2NoiseModel). Note that ifModel.tickare followed one after the other,Model.flush_noiseis 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.
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)from_layouts(*layouts[, setup])Creates a
Modelobject 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_recfor the specified qubit and its relative measurement index (for the given qubit).measure(qubits)measure_x(qubits)measure_y(qubits)measure_z(qubits)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)from_layouts(*layouts[, setup])Creates a
Modelobject 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_recfor the specified qubit and its relative measurement index (for the given qubit).measure(qubits)measure_x(qubits)measure_y(qubits)measure_z(qubits)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)