topqad_sdk.noiseprofiler.libnoise package

The available noise models are

  1. PhysicalDepolarizing

  2. UniformDepolarizing

class topqad_sdk.noiseprofiler.libnoise.PhysicalDepolarizing(*, preparation_error: Quantity, reset_error: Quantity, measurement_error: Quantity, one_qubit_gate_error: Quantity, two_qubit_gate_error: Quantity, T1_longitudinal_relaxation_time: Quantity, T2_transverse_relaxation_time: Quantity, preparation_time: Quantity, reset_time: Quantity, measurement_time: Quantity, one_qubit_gate_time: Quantity, two_qubit_gate_time: Quantity, noise_channel_prescription: str = 'circuit')[source]

A physical depolarizing noise model, based on the model described in Appendix E of Ref. [1].

It consists of three types of errors: gate errors, idling errors, and state preparation and measurement (SPAM) errors.

Gate Errors

Imperfect gates are modelled by adding a depolarizing noise channel at rate \(p\) to the gate qubits after the application of each gate, where the parameterization assumes that \(1 - p\) is the probability of leaving the input state unaltered.

The rate \(p\) is determined by utilizing the formula for the depolarizing channel’s average gate fidelity,

\[F_{\text{dep}, n} = 1 - \frac{(2^n - 1) 2^n}{2^{2n} - 1} p,\]

where \(n\) is the number of gate qubits.

Idling Errors

Any qubit that is idling experiences an error, dependent on both the \(T_1\) (longitudinal relaxation time) and the \(T_2\) (transverse relaxation time) of the qubit, as well as the time \(t\) it takes to apply the gate(s) to the active qubits.

The error is modelled with a one-qubit stochastic Pauli noise channel defined by the parameter vector

\[(p_x, p_y, p_z) = \left(\frac{1}{4} (1 - e^{-t/T_1}), \frac{1}{4} (1 - e^{-t/T_1}), \frac{1}{4} (1 + e^{-t/T_1} - 2 e^{-t/T_2})\right),\]

where \(p_x, p_y, p_z\) are the probabilities of \(X, Y, Z\) errors, respectively.

SPAM Errors

The errors in state preparation and reset are captured by assuming that, with rate \(p\), the orthogonal state is produced, that is, \(|0\rangle\) is prepared instead of \(|1\rangle\) and vice versa. Similarly, measurements in the \(Z\) basis are flipped at rate \(p\). In all three cases, the fidelity of the operation is

\[F_{\text{SPAM}} = \frac{P(0|0) + P(1|1)}{2},\]

from which we directly determine the rate \(p = 1 - F_{\text{SPAM}}\).

References

calculate_stabilization_time(unit='μs')[source]

Calculate the stabilization time.

Parameters:

unit (str) – An acceptable unit of time.

Returns:

stabilization time.

Return type:

Quantity

classmethod from_dict(noise_parameter_dictionary: dict[str, dict[str, float | str]], noise_channel_prescription: str = 'circuit') PhysicalDepolarizing[source]

Create noise model from a dictionary of parameters.

Parameters:
  • noise_parameter_dictionary (dict[str, dict[str, Union[float, str]]]) – The dictionary of parameters. Each key should be a parameter, and the value itself a dictionary with two keys: ‘value’ and ‘unit’. For unitless quantities set ‘unit’ to ‘’.

  • noise_channel_prescription (str, optional) – Name of prescription. Current option are [‘circuit’]. Defaults to ‘circuit’.

Returns:

The noise model.

Return type:

PhysicalDepolarizing

classmethod from_preset(parameter_set_name: str, noise_channel_prescription: str = 'circuit') PhysicalDepolarizing[source]

Create noise model from inbuilt sets of parameters.

Parameters:
  • parameter_set_name (str) – One of “baseline”, “target”, “desired”, which are parameters sets from Ref. [1].

  • noise_channel_prescription (str, optional) – Name of prescription. Current option are [‘circuit’]. Defaults to ‘circuit’.

Returns:

The noise model.

Return type:

PhysicalDepolarizing

noise_model_name = 'physical_depolarizing'

Name of the noise model.

static strength_gate_operation_noise_channel(F: float, n: int) float[source]

Calculate the strength p of a depolarizing noise channel whose average gate fidelity is F.

The channel parameterization assumes that (1-p) is the probability of leaving the input state unaltered.

Parameters:
  • F (float) – Average gate fidelity.

  • n (float) – number of gate qubits.

static strength_idle_qubit_noise_channel(T1_longitudinal_relaxation_time: float, t: float) float[source]

Calculate the strength p of a single qubit depolarizing noise channel on an idle qubit.

This is equivalent to the decay/dephasing channel with the thermal equilibrium state alpha_0 = 1/2 (see Eq. (7.144) of Ref. [1]). The physical meaning of alpha_0 = 1/2 is that it corresponds to the limit where the equilibrium temperature is infinite. The depolarizing channel parameterization assumes that (1 - p) is the probability of leaving the input state unaltered. It is assumed that the T2 (dephasing time) is equal to the T1 (relaxation time).

[1] M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information, 10th anniversary ed (Cambridge University Press, 2010).

Parameters:
  • T1_relaxation_time (float) – The T1 of a qubit.

  • t (float) – The idling duration of the qubit.

static strength_idle_qubit_stochastic_noise_channel(T1_longitudinal_relaxation_time: float, T2_transverse_relaxation_time: float, t: float) tuple[float, float, float][source]

Calculate the strength p of a single qubit stochastic Pauli noise channel on an idle qubit.

This is equivalent to the decay/dephasing channel with the thermal equilibrium state alpha_0 = 1/2 (see Eq. (7.144) of Ref. [1]). The physical meaning of alpha_0 = 1/2 is that it corresponds to the limit where the equilibrium temperature is infinite. The stochastic Pauli channel parameterization assumes that (1 - px - py - pz) is the probability of leaving the input state unaltered.

[1] M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information, 10th anniversary ed (Cambridge University Press, 2010).

Parameters:
  • T1_longitudinal_relaxation_time (float) – The T1 of a qubit.

  • T2_transverse_relaxation_time (float) – The T2 of a qubit.

  • t (float) – The idling duration of the qubit.

static strength_spam_operation_noise_channel(F: float) float[source]

Calculate the strength p of a Pauli X noise channel whose average fidelity is F.

F is assumed to be:

F = 1 - (P(1|0) + P(0|1))/2

i.e. one minus the average probability that the desired/prepared state has indeed been prepared/measured. The channel parameterization assumes that (1-p_x) is the probability of leaving the input state unaltered, and p_x is the probability that X error has been applied.

Parameters:

F (float) – Fidelity of the SPAM operation.

class topqad_sdk.noiseprofiler.libnoise.UniformDepolarizing(*, p: float, stabilization_time: Quantity = Quantity(value=1.0, unit='μs'), noise_channel_prescription: str = 'circuit')[source]

A simple uniform depolarizing noise model, in which all noise channels have the same strength \(p\). The noise channels added before or after every circuit operations are as follows.

  • Preparation and reset are followed by bit or phase flip errors, depending on the basis.

  • Measurements are noisy with probability \(p\) of error, and are followed by a one-qubit depolarizing noise channel.

  • One-qubit gates are followed by a one-qubit depolarizing noise channel.

  • Two-qubit gates are followed by a two-qubit depolarizing noise channel.

  • Idle qubits experience a one-qubit depolarizing noise channel at each tick.

This model was inspired by the model described in Appendix A of Ref. [1].

References

[1] C. Gidney, N. Shutty, and C. Jones, Magic State Cultivation: Growing T States as Cheap as CNOT Gates, (2024)

arXiv:2409.17595.

calculate_stabilization_time(unit='μs')[source]

Calculate the stabilization time.

Parameters:

unit (str) – An acceptable unit of time.

Returns:

stabilization time.

Return type:

Quantity

classmethod from_dict(noise_parameter_dictionary: dict[str, float], noise_channel_prescription: str = 'circuit')[source]

Create noise model from a dictionary of parameters.

Parameters:
  • noise_parameter_dictionary (dict[str, float]) – The dictionary of parameters. Dictionary is of the form {“p”: 0.01}.

  • noise_channel_prescription (str, optional) – Name of prescription. Current option are [‘circuit’]. Defaults to ‘circuit’.

noise_model_name = 'uniform_depolarizing'

Name of the noise model.