spin_pulse.environment.noise.noise_time_trace

Classes

NoiseType

Enumerate the supported noise models for spin-qubit simulations.

NoiseTimeTrace

Base class for generating and manipulating noise time traces.

Module Contents

class spin_pulse.environment.noise.noise_time_trace.NoiseType(*args, **kwds)[source]

Bases: enum.Enum

Enumerate the supported noise models for spin-qubit simulations.

Each enum value corresponds to the time-trace class used to generate the associated noise realization.

Noise types:
  • QUASISTATIC: Quasistatic noise generated by

    QuasistaticNoiseTimeTrace.

  • PINK: Pink (1/f) noise generated by PinkNoiseTimeTrace.

  • WHITE: White Gaussian noise generated by WhiteNoiseTimeTrace.

QUASISTATIC = 'QuasistaticNoiseTimeTrace'[source]
PINK = 'PinkNoiseTimeTrace'[source]
WHITE = 'WhiteNoiseTimeTrace'[source]
class spin_pulse.environment.noise.noise_time_trace.NoiseTimeTrace(duration)[source]

Base class for generating and manipulating noise time traces.

A noise time trace is represented as an array of length duration, containing the instantaneous noise values \(\epsilon(t)\) that affect the qubit. Subclasses implement specific noise models (quasistatic, pink, white, etc.) and populate the values array accordingly.

- duration

Total number of time steps in the noise trace.

Type:

int

- values

Array of noise values of length duration.

Type:

ndarray

Initializes an empty noise time trace of given duration.

Parameters:

duration (int) – Total number of time steps in the noise trace.

duration[source]
values[source]
ramsey_contrast(ramsey_duration)[source]

Compute the Ramsey contrast for a qubit subject to this noise trace.

The qubit is initialized in the equal superposition state \(\frac{\\lvert 0 \rangle + \\lvert 1 \rangle}{\\sqrt{2}}\) and evolves under a pure dephasing Hamiltonian \(H(t) = \\omega(t) Z\). The Ramsey contrast is obtained from the accumulated phase \(\\sum_t \\omega(t)\) over segments of length ramsey_duration. The trace is divided into independent experiments of equal length and the contrast is averaged over all experiments.

Parameters:

ramsey_duration (int) – Number of time steps per Ramsey experiment.

Returns:

Averaged Ramsey contrast of length ramsey_duration.

Return type:

  • float

plot_ramsey_contrast(ramsey_duration)[source]

Plot the Ramsey contrast computed from the noise trace.

Parameters:

ramsey_duration (int) – Number of time steps per Ramsey experiment.

plot(n_max=None)[source]

Plot the noise trace up to a specified number of points.

Parameters:

n_max (int | None) – Number of time steps to display. If None, the full trace is shown.