Skip to content

Temporal measurements and noise ​

IQ measurements, canonical temporal modes, baths, noise diagnostics, and the conversions between occupations, temperatures and noise temperatures.

See the API overview for other analyses and conventions for units and array ordering.

JosephsonCircuits.effectivetemperature Method
julia
effectivetemperature(w, nbar)

The thermal-equivalent temperature in kelvin of the occupation nbar at the angular frequency w: the temperature at which a mode at that frequency in thermal equilibrium has that occupation, the inverse of thermaloccupation, hbar*abs(w)/(k*log(1 + 1/nbar)), zero for nbar = 0. This is the temperature of the bath a qubit or a resonator at that frequency sees, and the temperature to give a port's termination for an incident field of that occupation. It is not a noise temperature (see noisetemperature). An occupation does not make a state thermal: the output of a pumped circuit has correlations between its modes which the temperature does not describe. A mode at zero frequency has no temperature for a positive occupation, which throws an ArgumentError.

Examples

julia
julia> effectivetemperature(2pi*5e9, 0.0)
0.0

julia> round(effectivetemperature(2pi*5e9, thermaloccupation(2pi*5e9, 0.05)), digits = 12)
0.05
source
JosephsonCircuits.noisequanta Method
julia
noisequanta(w, T)

The noise in quanta at angular frequency w of the noise temperature T in kelvin, k*T/(hbar*abs(w)), the inverse of noisetemperature. An amplifier with the input referred noise temperature T adds noisequanta(w, T) photons referred to its input, the nadd of its NoiseCovariance.

Examples

julia
julia> round(noisequanta(2pi*5e9, 2.0), digits = 3)
8.335
source
JosephsonCircuits.noisetemperature Method
julia
noisetemperature(w, N)

The noise temperature in kelvin of the noise N in quanta at angular frequency w, hbar*abs(w)*N/k: a noise spectral density in units of temperature, not the temperature of anything. What it includes is what N includes:

  • nbar + 1/2, the symmetrized noise of a mode, gives the symmetrized noise temperature, hbar*abs(w)/(2k) for the vacuum;

  • nbar alone gives the Rayleigh-Jeans temperature, zero for the vacuum;

  • 1/(2*QE), the noise at an output referred to the input the quantum efficiency is taken from, gives the system noise temperature, the vacuum at that input included.

noisequanta is the inverse.

Examples

julia
julia> round(noisetemperature(2pi*5e9, 1/2), digits = 5)
0.11998

julia> round(noisetemperature(2pi*5e9, thermaloccupation(2pi*5e9, 0.05) + 1/2), digits = 5)
0.12197
source
JosephsonCircuits.thermaloccupation Method
julia
thermaloccupation(w, temperature)

The occupation nbar = 1/(exp(hbar*abs(w)/(k*T)) - 1) of a mode at angular frequency w in thermal equilibrium at the physical temperature in kelvin: its mean number of photons, zero at zero temperature. The noise the mode carries is nbar + 1/2, the vacuum's half photon included. effectivetemperature is the inverse.

The occupation diverges at zero frequency, where it is Inf for a positive temperature. A negative or NaN temperature throws an ArgumentError.

Examples

julia
julia> thermaloccupation(2pi*5e9, 0.0)
0.0

julia> round(thermaloccupation(2pi*5e9, 0.05), sigdigits = 4)
0.008304

julia> round(thermaloccupation(2pi*5e9, 1.0), sigdigits = 4)
3.687
source
JosephsonCircuits.transientgain Method
julia
transientgain(solution, measurement, inputs; factorization = nothing,
    reuse = nothing)

The quadrature gain from the temporal modes of inputs to those of measurement, both TransientQuantumPlans on windows of the record, for a probe applied inside the input window only: each input mode's two quadratures are the incident waves of unit X and unit P at the input's port, evaluated at the grid and the stage times inside the window and zero outside it, driven through transienttangent and read in the measurement's modes. Returns the (2 nout, 2 nin) matrix, with the conditions as a trailing dimension for a TransientBatchSolution. This is the causal, pulsed gain, carrying the transients of the probe's own edges; the gain of transientnoise with an input plan is the response to the periodic Fourier mode of the window, extended over the record and started stationary, which is what a stationary amplifier's harmonic balance gain is. The two agree as the window grows past the circuit's memory. factorization and reuse are the tangent's.

source
JosephsonCircuits.transientiq! Method
julia
transientiq!(out, plan, traces)

The complex I/Q measurements of plan on the real port traces traces, a (port, time) matrix on the plan's backend, written into out, a complex (channel, window) matrix: one row per carrier of the plan and one column per complete window, in the peak amplitude convention of transientiqplan. Each channel is one mixing kernel, one forward and one backward FFT on the plan's workspace and one extraction kernel, so no samples by windows array is formed.

source
JosephsonCircuits.transientiq Method
julia
transientiq(plan, traces)

The complex I/Q measurements of plan on the real port traces traces, allocated on the plan's backend; see transientiq!.

source
JosephsonCircuits.transientiqplan Method
julia
transientiqplan(problem, times, frequencies; duration, window = :hann,
    ports = the first port, stride = 1, phasereference = first(times),
    backend = CPU())

Plan causal sliding I/Q measurements of uniformly sampled real port traces with shape (port, time) of problem, a TransientProblem or a solution of it. frequencies are the angular carrier frequencies w[c] in rad/s and ports the port number each carrier reads, which the plan resolves to the row of the trace, rows[c]. For normalized window taps h[k], the output is

z[c,n] = 2 sum(h[k] x[rows[c],n-k] exp(-im*w[c]*(t[n-k]-phasereference))).

Thus a resolved cosine of peak amplitude A and phase phi gives approximately A*exp(im*phi) when the doubled-carrier image is rejected by the window. The units match the input (volts or sqrt(watts)); these are peak, not RMS or photon amplitudes. I is real(z) and Q is imag(z).

window is :hann or :rectangular; duration is rounded to an integer number of sample intervals (at least three). Only complete windows are kept, every stride samples, without assumed prehistory. Use plan.times for causal availability or plan.centertimes for delay-corrected plotting. The reported 3 dB bandwidth is the positive-frequency half-width of the low-pass filter. Neither window is a brick-wall filter: choose sampling, duration and stride to control image leakage and aliasing. The input must already resolve the RF.

CPU uses FFTW and CUDA uses cuFFT with KernelAbstractions kernels. One FFT workspace is reused across channels; this avoids a samples-by-window array.

source
JosephsonCircuits.transientiqvjp! Method
julia
transientiqvjp!(rfweights, plan, iqweights)

Overwrite the real RF gradient of real(dot(iqweights, transientiq(plan,rf))). This is the exact transpose of the finite-window measurement, including normalization, overlap, decimation and multiple channels reading the same port. These RF weights, placed on the port rows of the outgoing waves, are the weights of transientadjoint, which propagates them to the currents and the initial state. The routine does not itself integrate an adjoint.

source
JosephsonCircuits.transientnoise Method
julia
transientnoise(solution, measurement; frequencies = the bins of the
    record, weights = 2pi/T, cutoff = nothing,
    baths = transientnoisebaths(solution.problem), method = :adjoint,
    inputs = nothing, commutationrtol = 1e-3, factorization = nothing,
    reuse = nothing)

The symmetrized quantum noise of a recorded transient, or of every condition of a TransientBatchSolution on one pass, in the temporal modes of measurement, a TransientQuantumPlan on a window of the recorded times: the physical baths, the port terminations and the internal resistors, propagated through the linearization about the complete recorded trajectory, pump and signals together. For a batch the covariance, the commutator and the gain carry the conditions as the trailing dimension and the diagnostics are a vector; on the host the conditions are tiled across the threads of the session, each tile its own responses, as the solve splits them. frequencies are the positive nodes of a quadrature over the bath spectrum, angular in rad/s, and weights its weights in rad/s. By default the bath is periodic over the record, of duration T = length(solution.times)*solution.dt: its positive Fourier bins w = 2pi*k/T with weights 2pi/T, up to cutoff in rad/s when one is given and to the Nyquist frequency of the record otherwise, which is the complete bath of the recorded steps. The adjoint method contracts the bins of the default bath by fast Fourier transforms over the recorded times, and frequencies given by a sum per bath, frequency and time; it factorizes the stationary operator once per frequency and distinct initial state; the forward method drives two directions per bath and frequency, so a long record wants a cutoff there, and loss spread along a line a few bands given as frequencies. Each bath at each frequency is a pair of cosine and sine Norton currents of amplitude 2 sqrt(hbar w dw/(2pi R)), whose independent quadratures have variance nbar + 1/2, started from the stationary response of the circuit to them at the initial state, under the trapezoidal and backward Euler rules the rule's own, so that the fluctuations stored before the record and their correlation with the forcing are kept; the trajectory must therefore start at a classical equilibrium under a constant drive, with no inductive flux or junction phase moving, and the measurement window may begin after the drive has settled. With an input plan the bath is the periodic Fourier bath of the measurement window, its tones extended over the whole record and started stationary, and the gain is the response to those periodic modes; a probe applied only inside the window is a different quantity, to be computed by driving that waveform.

method = :forward propagates the bath quadratures forward, two tangent directions per bath and frequency through transienttangent; method = :adjoint propagates the measured quadratures backward through transientadjoint, whose derivatives with respect to the bath currents at every recorded time are the bath kernels, contracted against the frequencies as a discrete Fourier sum at the grid and the stage times the adjoint hands over, by fast transforms on the bins of the record, so the frequency count costs sums rather than integrations; factorization is the sparse factorization the responses step on, as for transienttangent, which on the host also factorizes the stationary operator at every bath frequency (under a device, the host's default does), and reuse a TransientReuse. Both return the same covariance, addedcovariance, commutator, expectedcommutator, diagnostics (from transientquantumdiagnostics), and, with an input plan inputs on the same record, the incremental quadrature gain from its modes. covariance is the whole noise of the measured modes, the counterpart of harmonic balance's Vout, and addedcovariance its part from the internal baths, the resistors and the blocks, the noise the circuit adds, the counterpart of Cnoise; the rest is the port terminations'. A failed diagnostic is returned as such, not rescaled away; refine the bath cutoff, the frequency spacing, the record and the step independently before reading a quantum efficiency with transientquantumefficiency.

source
JosephsonCircuits.transientnoisebaths Method
julia
transientnoisebaths(problem; temperature = 0.0)

The independent equilibrium baths of a circuit in time: every matched, port owned termination is one external bath, every finite internal resistor one internal bath, and every lossy constant scattering block the independent channels of its emitted noise wave, whose covariance is (nbar + 1/2)(I - S S') (Bosma's relation, as the linearized solver has it), one channel per positive eigenvalue of the commutator I - S S', while a rational block, whose S depends on frequency, has one channel per port, correlated by its group at each bath frequency; from the compiler's termination ownership, the bound values, the component temperatures and the blocks' noise models, ThermalEquilibrium(T) stating a block's temperature, Passive() taking the default, Lossless() asserting the block emits nothing, which is checked, and NoiseCovariance(V) stating the noise outright, as an amplifier given by its scattering parameters does: such a block's ports are channels correlated by its group, whose covariance is V and whose commutator is I - S S', so the block adds the noise it states, held to the minimum the commutation relations require, and its output obeys them; a pumped block which states its noise is a group whose channels are correlated across the bath frequencies its harmonics relate (see PairLadder), and one declared lossless is no bath. temperature is the default in kelvin of every internal resistor and block, which a component's own stated temperature overrides; a port's termination is a bath at its own temperature, zero unless MatchedTermination(temperature = T) states one, which the analysis temperature does not change. Every port must own a matched finite termination; an open resistor adds no bath. The same temperatures and models set the noise of hblinsolve, so the two solvers compare at any temperature.

source
JosephsonCircuits.transientquantum! Method
julia
transientquantum!(out, plan, traces)

The photon normalized quadratures (X1, P1, X2, P2, ...) of the temporal modes of plan measured on the real power wave traces traces in sqrt(W), a (port, time) matrix on the plan's backend covering the plan's record, written into the real vector out: one product of the plan's weights with each mode's port trace, so a mode's quadratures are exact linear functionals of the trace. The traces, the weights and the output must share a backend.

source
JosephsonCircuits.transientquantum Method
julia
transientquantum(plan, traces)

The quadratures of the temporal modes of plan measured on traces, allocated on the plan's backend; see transientquantum!.

source
JosephsonCircuits.transientquantumefficiency Method
julia
transientquantumefficiency(gain, covariance; rtol=1e-3)

Phase-insensitive single-mode metrics for a real 2x2 quadrature gain and an isotropic canonical output covariance (vacuum = I/2). The gain is a scaled rotation, phase preserving, or a scaled reflection, phase conjugating, as from a signal to its idler. gain is the incremental response to a coherent displacement, not a ratio of large loaded amplitudes. Returns photon gain, QE, QEideal and QE/QEideal. The QE is G/(2v), the covariance holding every bath in its state, the input's own included, as hblinsolve's is. Uses the ideal efficiency of harmonic balance, which hbsolve applies to its idler outputs too. Phase-sensitive gain or anisotropic noise is rejected: retain the full gain/covariance for those cases. The caller must also verify commutator closure and bath-basis convergence.

source
JosephsonCircuits.transientquantumplan Method
julia
transientquantumplan(problem, times, coefficients::AbstractMatrix;
    ports = the first port, backend = CPU())
transientquantumplan(problem, times, frequencies::AbstractVector;
    ports = the first port, envelopes = nothing, backend = CPU())

Define photon-normalized temporal modes on a uniformly sampled half-open record [times[1], times[1]+length(times)*dt). Do not include the repeated right endpoint. For N samples the coefficient rows are Fourier bins k=1:fld(N-1,2) at the angular frequencies w=2pi*k/(N*dt); DC and a self-conjugate Nyquist bin are excluded. Each coefficient column must have unit Euclidean norm. Different columns may overlap. problem is the TransientProblem whose traces the plan measures, or a solution of it, and ports the port number each mode reads, which the plan resolves to the row of the trace.

The frequency convenience form takes the angular frequencies w of the modes in rad/s and creates bin-aligned monochromatic modes when envelopes=nothing. Otherwise each column of envelopes[sample,mode] defines g(t)=envelope(t)*exp(-im*w*(t-times[1])); project it onto positive Fourier bins and normalize the resulting coefficients. Supply enough RF bandwidth to resolve the carrier and envelope. Frequencies must lie strictly below the Nyquist frequency pi/dt.

A canonical bin has real physical power wave a(t)=sqrt(hbar*w/(N*dt))*(X*cos(w*t)+P*sin(w*t)). The readout includes the frequency-dependent 1/sqrt(hbar*w) weighting before combining bins. A resolved cosine of peak amplitude A in one full-record bin has X=A_sqrt(N_dt/(hbar*w)), P=0 and mean photon number X^2/2. The P convention is the negative of imag(transientiq(...)) for that cosine's classical phasor; transientiq and transientdemodulate return peak amplitudes.

Windows are finite-record mode definitions, not independent white-noise samples. Use gram, vacuum and commutator when modes/windows overlap. The plan is read-only after construction and has no mutable shared FFT workspace.

source
JosephsonCircuits.transientquantumvjp! Method
julia
transientquantumvjp!(out, plan, weights)

The exact transpose of transientquantum!: the real trace weights, a (port, time) matrix on the plan's backend, of the functional dot(weights, transientquantum(plan, traces)) for the quadrature weights given, written into out. Placed on the port rows of the outgoing waves over the plan's window, these are the weights of transientadjoint, which propagates a measured quadrature back to the currents and the initial state; the noise builds its objectives this way.

source