3. Package API
3.1. Subpackages
- 3.1.1. qmix.exp package
- 3.1.1.1. Submodules
- 3.1.1.2. qmix.exp.clean_data module
- 3.1.1.3. qmix.exp.exp_data module
DCDataMixerNoisePumpedDataPumpedData.mixer_noise()PumpedData.plot_all()PumpedData.plot_error_surface()PumpedData.plot_gain()PumpedData.plot_gain_noise_temp()PumpedData.plot_if()PumpedData.plot_iv()PumpedData.plot_ivif()PumpedData.plot_mixer_noise()PumpedData.plot_noise_temp()PumpedData.plot_simulated()PumpedData.plot_yfac_noise_temp()
initialize_dir()plot_if_spectrum()plot_overall_results()
- 3.1.1.4. qmix.exp.if_data module
- 3.1.1.5. qmix.exp.if_response module
- 3.1.1.6. qmix.exp.iv_data module
- 3.1.1.7. qmix.exp.parameters module
- 3.1.1.8. Module contents
- 3.1.2. qmix.mathfn package
- 3.1.3. qmix.misc package
3.2. Submodules
3.3. qmix.circuit module
This module contains classes and functions to describe the embedding circuit.
Description:
In experimental systems, SIS junctions are embedded within complex RF networks. These networks are referred to as the embedding circuit. Since all of the components in these embedding circuits are linear, the embedding circuit can be reduced to a Thevenin equivalent circuit, with one for each tone and harmonic.
To fully describe the embedding circuit, 3 bits of information are needed for each signal that is applied to the junction:
the frequency of the applied signal,
the Thevenin voltage of the embedding circuit at this freq., and
the Thevenin impedance of the embedding circuit at this freq.
The main class in this module (EmbeddingCircuit) allows the user to
build an embedding circuit in the proper format. MultiJunctionCircuit
does the same for several junctions in one network: a multi-port Thevenin
equivalent (a vector of voltages and an impedance matrix) for each tone and
harmonic.
- class qmix.circuit.EmbeddingCircuit(num_f=1, num_p=1, vb_min=0, vb_max=2, vb_npts=201, fgap=None, vgap=None, rn=None, name='')
Bases:
objectClass for building and describing the embedding circuit.
This includes the frequencies, Thevenin voltages and Thevenin impedances of all signals applied to the junction.
Note
Unless specified otherwise, all input values are normalized. The voltages are normalized to the gap voltage, resistances are normalized to the normal-state resistance, currents are normalized to gap current, and frequencies are normalized to the gap frequency. Refer to the argument descriptions below to see if the value should be normalized or not.
Creating an instance of this class will set the sizes and data types of all of the class attributes, but the actual values will need to be set manually. In this way, this class is sort of like a fancy struct. The class attributes that have to be set manually are:
freq: frequencies (normalized to the gap frequency)vt: Thevenin voltage (normalized to the gap voltage)zt: Thevenin impedance (normalized to the normal resistance)
See the attribute descriptions below for information about how to do this.
Example
Here we will create an instance of the embedding circuit class with 2 tones and 3 harmonics:
>>> cct1 = EmbeddingCircuit(2, 3, name='Test 1') >>> print(cct1) Embedding circuit (Tones:2, Harmonics:3): Test 1
Once initialized, we can begin defining the properties of the embedding circuit. I normally start with the frequencies:
>>> cct1.freq[1] = 0.30 # first tone >>> cct1.freq[2] = 0.32 # second tone
Then, we have to set the voltages and impedances for all of the different signals. For example, for the 1st harmonic of the 1st tone:
>>> cct1.vt[1,1] = 0.5 # Thevenin voltage >>> cct1.zt[1,1] = 0.3 + 1j * 0.1 # Thevenin impedance
This has to be done for each signal (a total of 6 times in this case).
In order to use non-normalized values (e.g., set the available power of a signal in units [W]), we need to define the electrical properties of the junction during initialization. For example:
>>> cct2 = EmbeddingCircuit(1, 1, vgap=2.8e-3, rn=14.)
You can now set the frequencies. E.g.:
>>> cct2.set_freq(250, f=1, units='GHz') >>> round(cct2.freq[1], 4) 0.3693
Once an impedance has been set, you can also set the power of the signal using absolute units. Here we will set the available power for the first harmonic of the first tone to 10 nW (10e-9 W).
>>> cct2.zt[1,1] = 0.5 >>> cct2.set_available_power(10, 1, 1, 'nW')
And we can then display this power in units [dBm].
>>> cct2.available_power(1, 1, 'dBm') -50.0
- Parameters:
num_f (int, optional, default is 1) – Number of fundamental frequencies (tones) applied to the junction.
num_p (int, optional, default is 1) – Number of harmonics included for each tone.
vb_min (float, optional, default is 0) – Minimum bias voltage.
vb_max (float, optional, default is 2) – Maximum bias voltage.
vb_npts (int, optional, default is 201) – Number of points in bias voltage sweep.
fgap (float, optional) – Gap frequency of the junction in units [Hz]. This is equal to
e*Vgap/h, whereeis the charge of an electron,Vgapis the gap voltage, andhis the Planck constant.fgapis used to normalize and de-normalize frequency values (that’t it!).vgap (float, optional) – Gap voltage of the junction in units [V]. This is the voltage where the sharp non-linearity in the DC I-V curve occurs (a.k.a., the transition voltage).
rn (float, optional) – Normal-state resistance of the junction in units [ohms]. This is the resistance of the junction at a temperature slight above the critical temperature. It is found by calculating the dynamic resistance of the DC I-V curve above the gap voltage.
name (str, optional) – Name used to describe this specific instance.
- freq
An array for the frequencies normalized to the gap frequency. This is a 1-dimensional array of real numbers. It contains the frequencies of all of the fundamental tones that are applied to the junction. The normalized frequency is equivalent to the normalized photon voltage. The photon voltage is defined as
hf/e, wherehis the Planck constant,fis the frequency of the fundamental tone, andeis the charge of an electron. Note that this array is 1-based, meaning that the frequency of the 1st tone is found in.freq[1]. (The index represents the tone number.) This attribute must be set after initialization!- Type:
numpy.ndarray
- vt
An array for the Thevenin voltage normalized to the gap voltage. This is a 2-dimensional array of complex values. It contains the voltages for all of the Thevenin equivalent circuits (which describe the embedding circuit). In order, the indices are:
.vt[f,p]for tonefand harmonicp. Note that this array is 1-based, meaning that the voltage for tone number 2 / harmonic number 3 is stored invt[2,3]. This attribute must be set after initialization!- Type:
numpy.ndarray
- zt
An array for the Thevenin impedance array normalized to the normal-state resistance. This is a 2-dimensional array of complex values. It contains the impedances of all of the Thevenin equivalent circuits (which describe the embedding circuit). In order, the indices are:
.zt[f,p], for tonefand harmonicp. Note that this array is 1-based, meaning that the impedance for tone number 2, and harmonic number 3 is stored inzt[2,3]. This attribute must be set after initialization!- Type:
numpy.ndarray
- num_f
Number of fundamental frequencies (tones) applied to the junction.
- Type:
int
- num_p
Number of harmonics included for each tone.
- Type:
int
- num_n
Total number of signals. This is equal to
num_f*num_p.- Type:
int
- fgap
Gap frequency of the junction in units [Hz]. This is equal to
e*Vgap/h, whereeis the charge of an electron,Vgapis the gap voltage, andhis the Planck constant. Note thatE=fgap*eis the energy required to break Cooper pairs, so at frequencies above thefgapthe superconductors will begin to become lossy. Here,fgapis used to normalize and de-normalize frequency values (that’t it).- Type:
float
- vgap
Gap voltage of the junction in units [V]. This is the voltage where the sharp non-linearity in the DC I-V curve occurs (i.e., the transition voltage). This value is used to normalize and de-normalize voltages.
- Type:
float
- igap
Gap current of the junction in units [A]. This is equal to
vgap/rn. This value is used to normalize and de-normalize currents.- Type:
float
- rn
Normal-state resistance of the junction in units [ohms]. This is the resistance of the junction at a temperature slightly above the critical temperature. It is found by calculating the dynamic resistance of the DC I-V curve above the gap voltage. This value is used to normalize and de-normalize resistances.
- Type:
float
- vb
Array for the DC bias voltage sweep. This value is normalized to the gap voltage.
- Type:
numpy.ndarray
- vb_npts
Number of points in the bias voltage sweep.
- Type:
int
- name
A name to describe this instance of the embedding circuit class.
- Type:
str
- comment
A list of comments to describe the different signals. For example, to describe tone 1/harmonic 1 as the local-oscillator signal, you might use
cct.comment[1][1] = "LO". This has to be set after the initialization of the EmbeddingCircuit class.- Type:
list
- available_power(f=1, p=1, units='W')
Return available power of tone
fand harmonicp.Note
Gap voltage and normal resistance must be set prior to using this method. If they are not, an error will be raised.
- Parameters:
f (int, optional, default is 1) – Tone index number.
p (int, optional, default is 1) – Harmonic index number.
units (str, optional, default is 'W') – Units for power. One of ‘W’, ‘mW’, ‘uW’, ‘nW’, ‘pW’, ‘fW’, ‘dBm’, or ‘dBW’.
- Returns:
Available power in specified units
- Return type:
float
- initialize_vj()
Initialize junction voltage array.
Returns an empty matrix that is the shape that
vjshould be (the voltage across the junction). Strictly speaking,vjshouldn’t be saved within this class, but it is okay for this class to initializevjsince it has all the data about what the matrix sizes should be.This function is useful when you want to set the voltage across the junction directly (skipping the harmonic balance procedure).
- Returns:
An empty matrix for the junction voltage
- Return type:
ndarray
- lock()
Make all Numpy arrays contained within this class unwriteable.
This can be useful for debugging. An error will be raised if you try to change the values of the Numpy arrays while they are locked.
- print_info()
Print information about the embedding circuit to the terminal.
- save_info(filename='embedding-circuit.txt')
Save this embedding circuit to a text file.
This text file can then be read in by
read_circuitin order to regenerate the embedding circuit.- Parameters:
filename (string) – Filename for embedding circuit file
- set_alpha(alpha, f=1, p=1, zj=0.66)
Set the drive level of tone
fand harmonicp(approximate).This method guesses what the Thevenin voltage should be in order to get the desired drive level, but you won’t actually know what the drive level is until you run the simulation.
Note
Frequency and Thevenin impedance must be set prior to using this method. Otherwise, an assertion error will be raised.
- Parameters:
alpha (float) – drive level, alpha = voltage / vph
f (int, optional, default is 1) – tone
p (int, optional, default is 1) – harmonic
zj (float, optional, default is 0.66) – the impedance to assume for the junction (normalized to the normal-state resistance). This value will depend on frequency and pump level.
- set_available_power(power, f=1, p=1, units='W')
Set available power of tone
fand harmonicp.This method will set the Thevenin voltage in order to provide the correct power level.
Note
The gap voltage, normal resistance and Thevenin impedance must be set prior to using this method. Otherwise, an assertion error will be raised.
- Parameters:
power (float) – power, in given units
f (int, optional, default is 1) – tone
p (int, optional, default is 1) – harmonic
units (str, optional, default is 'W') – units for power. One of ‘W’,
'mW'
'uW'
'nW'
'pW'
'fW'
'dBm'
'dBW'. (or)
- set_freq(value, f=1, units='Hz')
Set the frequency of tone
f.Normally, this can be done by setting the value of the attribute directly. E.g.:
>>> cct = EmbeddingCircuit(1, 1, vgap=2.8e-3, rn=14.) >>> cct.freq[1] = 0.5
However, if you would instead like to use non-normalized units, this method can be very handy. E.g.:
>>> cct.set_freq(350, f=1, units='GHz') >>> round(cct.freq[1], 2) 0.52
Note
The gap frequency or the gap voltage must be defined in order to use this method.
- Parameters:
value (float) – value to set using given units
f (int, optional, default is 1) – tone number
units (str, optional, default is 'Hz') – units for input value, ‘Hz’ for frequency in units Hz, ‘V’ for photon voltage in units V, and ‘norm’ for either normalized photon voltage or normalized frequency. SI prefixes can also be included: ‘MHz’, ‘GHz’, ‘THz’, and ‘mV’.
- set_name(name, f=1, p=1)
Set a name for a given tone and harmonic combination.
This has no effect on the simulation. It’s just nice for keeping track of the different signals.
- Parameters:
name (str) – name of tone/harmonic
f (int, optional, default is 1) – frequency number to set
p (int, optional, default is 1) – harmonic number to set
- unlock()
Make all Numpy arrays contained within this class writeable.
This can be useful for debugging.
- property vph
Get photon voltage.
The photon voltage (normalized to the gap voltage) is equivalent to the frequency (normalized to the gap frequency), so this is just an alias for
freq. It is kept for backwards compatibility.
- class qmix.circuit.MultiJunctionCircuit(num_j=2, num_f=1, num_p=1, vb_min=0, vb_max=2, vb_npts=201, fgap=None, vgap=None, rn=None, name='')
Bases:
objectEmbedding circuit for several junctions in one linear network.
With
num_jjunctions, the embedding circuit at each tone and harmonic is anum_j-port Thevenin equivalent: a vector of open-circuit voltages and an impedance matrix. The voltages across the junctions satisfy:vj[j, f, p] = vt[j, f, p] - sum_l zt[j, l, f, p] * ij[l, f, p]
where
ij[l]is the tunneling current of junctionl(out of the network, into the junction). The coupling between the junctions (e.g., a twin-junction tuning circuit, or a series array) is in the off-diagonal elements ofzt.qmix.network.set_theveninsetsvtandztfrom an S-parameter network.Note
The junction axis is first in all arrays, and the junctions are numbered from 0:
vt[j],zt[j, l],vb[j]andvj[j](fromharmonic_balance) have the same shape as for a single junction. The tone and harmonic axes are 1-indexed as inEmbeddingCircuit.All values are normalized to one gap voltage and normal-state resistance (
vgapandrn). The junctions can be different:area[j]: normal-state conductance relative to1 / rn(the relative area, for junctions with the same R_n A), i.e., the normal resistance of junctionjisrn / area[j]. It scales the tunneling current.gap_voltage[j]: gap voltage relative tovgap(default 1). The response function of junctionj(normalized to its own gap voltage) is evaluated atv / gap_voltage[j]and scaled bygap_voltage[j](qmix.respfn.GapScaledRespFn).The response function (the shape of the I-V curve): pass a list to
harmonic_balance,qmix.qtcurrent.qtcurrent, etc.
set_junctionsetsareaandgap_voltagefrom the physical values (as in SuperMix, where each junction has its own gap voltage, normal resistance and I-V curve).By default, each junction is voltage biased: its DC voltage is set by
vb[j], and all junctions get the same bias sweep (a 1-D array is used for all junctions). ForNidentical, identically pumped junctions in series,cct.vb = vb / Nis enough.DC bias network: otherwise (e.g., a series array of junctions with different areas or different pumping, or a bias resistor), the DC voltages depend on the DC tunneling currents. A linear DC network (
set_dc_network, orset_series_biasfor series strings) addsnum_jequations:sum_l dc_a[r, l] * v0[l] + sum_l dc_b[r, l] * i0[l] = dc_rhs[r, i]
between the DC voltages
v0[j]and the DC tunneling currentsi0[j](includingarea).harmonic_balancethen solves for the DC voltages too, and returns them along with the junction voltage (vj, vb = harmonic_balance(...));vbis only the initial guess. Setcct.vb = vbbefore using other functions (e.g.,qmix.qtcurrent.qtcurrent).Example
Two junctions (a twin-junction circuit) with one tone:
>>> cct = MultiJunctionCircuit(2, 1, 1, vb_npts=51) >>> cct.freq[1] = 0.33 >>> cct.vt[:, 1, 1] = [0.4, 0.3j] >>> cct.zt[:, :, 1, 1] = [[0.5, 0.1j], [0.1j, 0.4 - 0.2j]] >>> print(cct) Multi-junction embedding circuit (Junctions:2, Tones:1, Harmonics:1)
- Parameters:
num_j (int, optional, default is 2) – Number of junctions.
num_f (int, optional, default is 1) – Number of tones.
num_p (int, optional, default is 1) – Number of harmonics.
vb_min (float, optional, default is 0) – Minimum bias voltage.
vb_max (float, optional, default is 2) – Maximum bias voltage.
vb_npts (int, optional, default is 201) – Number of bias voltages.
fgap (float, optional) – Gap frequency, in [Hz].
vgap (float, optional) – Gap voltage, in [V].
rn (float, optional) – Normal-state resistance of a junction with
area == 1, in [ohms].name (str, optional) – Name used to describe this instance.
- freq
Frequencies of the tones,
freq[f](normalized to the gap frequency).- Type:
numpy.ndarray
- vt
Thevenin (open-circuit) voltages,
vt[j, f, p](normalized to the gap voltage).- Type:
numpy.ndarray
- zt
Thevenin impedance matrices,
zt[j, l, f, p](normalized to the normal-state resistance).- Type:
numpy.ndarray
- area
Normal-state conductance of each junction relative to
1 / rn(relative area; scales its tunneling current), default is 1.- Type:
numpy.ndarray
- gap_voltage
Gap voltage of each junction relative to
vgap, default is 1.- Type:
numpy.ndarray
- dc_a, dc_b
DC bias network (
num_jxnum_j), or None (voltage bias, the default)- Type:
numpy.ndarray
- dc_rhs
Right-hand side of the DC bias network,
dc_rhs[r, i], or None- Type:
numpy.ndarray
- num_j
Number of junctions.
- Type:
int
- num_f
Number of tones.
- Type:
int
- num_p
Number of harmonics.
- Type:
int
- num_n
Number of signals per junction (
num_f * num_p).- Type:
int
- fgap, vgap, igap, rn
Junction properties (or None).
- Type:
float
- name
Name of this instance.
- Type:
str
- clear_dc_network()
Remove the DC bias network (back to voltage bias at
vb).
- property has_dc_network
Is there a DC bias network (i.e., are the DC voltages unknowns)?
- initialize_vj()
Empty junction voltage array,
vj[j, f, p, i].- Returns:
An empty matrix for the junction voltages
- Return type:
ndarray
- junction(j)
Single-junction view of junction
j(starting from 0).The result has the frequencies and the bias voltage of junction
j, so it can be used with single-junction functions (e.g.,qmix.qtcurrent.qtcurrentwithvj[j]). Itsvtandztarevt[j]andzt[j, j]. These are only the Thevenin equivalent circuit of the junction if it isn’t coupled to the other junctions. Like all values of the circuit, it is normalized tovgapandrn:area[j]andgap_voltage[j]are not included (qmix.qtcurrent.junction_respgives the response function of the junction in these units).- Parameters:
j (int) – Junction (starting from 0)
- Returns:
Embedding circuit of junction j
- Return type:
- set_dc_network(a, b, rhs)
Set a linear DC bias network.
The DC voltages
v0[j]and the DC tunneling currentsi0[j](normalized, includingarea) of the junctions satisfynum_jequations:sum_l a[r, l] * v0[l] + sum_l b[r, l] * i0[l] = rhs[r, i]
at each bias point
i. For example,a = 1,b = 0is voltage bias (v0 = rhs),a = 1,b = Ris a DC Thevenin circuit, anda = 0,b = 1is current bias. Seeset_series_biasfor series strings. The bias voltagesvbare set to an initial guess (each junction replaced by its normal resistance), unless that is singular.- Parameters:
a (ndarray) – Coefficients of the DC voltages,
num_jxnum_jb (ndarray) – Coefficients of the DC currents,
num_jxnum_jrhs (ndarray) – Right-hand side,
rhs[r, i]; a 1-D array of lengthnum_jis used for all bias points
- set_junction(j, vgap=None, rn=None)
Set the gap voltage and normal-state resistance of junction
j.Sets
gap_voltage[j] = vgap / self.vgapandarea[j] = self.rn / rn, so the circuit’svgapandrnmust be set. The response function of the junction should be normalized to its own gap voltage and normal-state resistance (e.g.,qmix.respfn.RespFnFromIVDatawith its ownvgapandrn).- Parameters:
j (int) – Junction (starting from 0)
vgap (float, optional) – Gap voltage of the junction, in [V]
rn (float, optional) – Normal-state resistance of the junction, in [ohms]
- set_series_bias(vbias, r_bias=0.0, junctions=None)
Bias junctions in series with one voltage source.
All junctions are connected in series (or several series strings in parallel, see
junctions) across the bias voltagevbias, through a bias resistancer_bias. The DC current is the same in all junctions of a string, and the DC voltages of a string add up tovbias - r_bias * (total DC current). The DC voltages are found byharmonic_balance(seeset_dc_network).Note
Below the gap, the DC I-V curve is almost flat, so the split of the bias voltage between different junctions is very sensitive to the leakage current. Pumped I-V curves with negative differential resistance can have several solutions;
harmonic_balancefinds the one closest to the initial guess (vb, set here assuming that the junctions are resistors).- Parameters:
vbias (ndarray) – Bias voltage across the series string(s), normalized to the gap voltage,
vbias[i]r_bias (float, optional) – Bias resistance (normalized to
rn), default is 0junctions (list, optional) – Junctions in each series string, as a list of lists of junction indices (starting from 0); every junction must be in exactly one string. The strings are in parallel. Default is one string with all junctions.
- property vb
DC bias voltages,
vb[j, i](normalized to the gap voltage). Assigning a 1-D array sets it for all junctions.
- property vb_npts
Number of bias voltages.
- property vph
Photon voltage (alias for
freq).
- qmix.circuit.read_circuit(filename)
Build an embedding circuit from an embedding circuit file.
This function will build an instance of the
EmbeddingCircuitclass based on a file previously generated by theEmbeddingCircuit.save_infomethod.- Parameters:
filename (str) – filename of the embedding circuit file
- Returns:
instance of the embedding circuit class
- Return type:
3.4. qmix.harmonic_balance module
This module contains functions to perform harmonic balance of non-linear SIS mixer circuits.
Description
Each signal that is applied to an SIS junction can be represented by a Thevenin equivalent circuit (see qmix.circuit). This circuit will then induce a voltage across the SIS junction. The exact voltage that is induced depends on the impedance of the SIS junction. However, this impedance changes depending on the other signals that are applied to the junction.
Harmonic balance is a procedure to solve for the voltage across the SIS junction for each signal that is applied to the junction. This techniques uses Newton’s method to find the solution numerically.
Several junctions in one embedding network (
qmix.circuit.MultiJunctionCircuit) are solved together: the unknowns are the voltages of all junctions, and the Jacobian couples them through the off-diagonal Thevenin impedances. Since the current of each junction only depends on its own voltage, the derivatives of all junctions’ currents are found from the same perturbed voltages, so a new Jacobian costs 2 * num_n current calculations per junction (as for one junction).
- qmix.harmonic_balance.check_hb_error(vj_check, cct, resp, num_b=15, stop_rerror=0.001, vb=None)
Check the results from the harmonic_balance function.
Just to double check. Mostly for debugging purposes.
- Parameters:
vj_check (ndarray) – The voltage across junction to check
cct (qmix.circuit.EmbeddingCircuit) – Embedding circuit (or
qmix.circuit.MultiJunctionCircuit)resp (qmix.respfn.RespFn) – Response function (or a list, one per junction)
num_b (optional) – Summation limits for phase factor coefficients, default is 15
stop_rerror (float, optional) – Maximum acceptable relative error, default is 0.001
vb (ndarray, optional) – DC voltages from
harmonic_balance, for a circuit with a DC bias network (the DC equations are checked too), default iscct.vb
- Raises:
AssertionError – If the stop error is not met
- qmix.harmonic_balance.harmonic_balance(cct, resp, num_b=15, max_it=None, stop_rerror=0.001, vj_initial=None, damp_coeff=1.0, mode='o', verbose=True, zj_guess=0.67, reuse_jacobian=True, method='auto', line_search=True, warm_start=False, jacobian='analytic', vb_initial=None)
Perform harmonic balance.
Determine the harmonic balance of the junction + embedding circuit system. Uses Newton’s method to find the solution. For more information, see Garrett (2018); Kittara (2002); Kittara, Winthington & Yassin (2007); or Withington, Kittara & Yassin (2003). [Full references in online docs.]
For several junctions, pass a
qmix.circuit.MultiJunctionCircuit. The junction voltage then has the junction axis first,vj[j, f, p, i], andrespcan be a list (one response function per junction).With a DC bias network (
qmix.circuit.MultiJunctionCircuit.set_dc_networkorset_series_bias, e.g., for a series array), the DC voltages of the junctions are unknowns too: they are solved together with the junction voltage and returned with it (vj, vb;cct.vbis only the initial guess).- Parameters:
cct (qmix.circuit.EmbeddingCircuit) – Embedding circuit (or
qmix.circuit.MultiJunctionCircuit)resp (qmix.respfn.RespFn) – Response function (or a list, one per junction)
num_b (int/tuple, optional) – Summation limits for phase factor coefficients, default is 15
method (str, optional) – Method used by
qmix.qtcurrent.qtcurrentto sum over the phase factor coefficients:'direct','fourier'or'auto', default is'auto'(seeqmix.qtcurrentfor details)max_it (int, optional) – Maximum number of iterations, default is 30 (
MAX_IT), or 60 with a DC bias network (MAX_IT_DC). Most cases converge in ~5 iterations (and stop there), but strong pumping into a large embedding impedance can take ~20.stop_rerror (float, optional) – Maximum acceptable relative error, default is 0.001
vj_initial (ndarray, optional) – Initial guess of junction voltage (vj), default is None
damp_coeff (float, optional) – Dampening coefficient for correction factor (0-1), default is 1. With
line_search=True, this is the initial step length of the line search.mode (string, optional) – output vj (‘o’), print (‘p’), output extra data (‘x’), default is “o”
verbose (bool, optional) – print info to terminal if true, default is True
zj_guess (float, optional) – guess of the junction impedance, used to generate the initial guess of vj, default is 0.67
reuse_jacobian (bool, optional) – reuse the Jacobian from the previous iteration while the error is still decreasing quickly (each new Jacobian requires 2 * num_n calls to the tunneling current function), default is True
line_search (bool, optional) – backtracking line search, default is True. At each bias voltage, a Newton step is only accepted if it reduces the error enough; otherwise it is shortened. This prevents divergence when the junction loads the embedding circuit strongly (e.g., large embedding impedance near the gap). Each shortened step costs one call to the tunneling current function, but full steps cost nothing extra.
warm_start (bool, optional) – for multi-tone simulations, first solve the harmonic balance for the strongest tone (largest Thevenin voltage) on its own, and use the result as the initial guess for that tone, default is False. This is cheap (single-tone tunneling currents are much faster to calculate) and typically cuts the number of multi-tone iterations by 2-3x when one tone (e.g., the LO) is much stronger than the others, but it is not always faster. Ignored if
vj_initialis given or there is only one tone.jacobian (str, optional) – how the Jacobian is calculated:
'analytic'(default) or'numerical'. The analytic Jacobian (qmix.qtcurrent.qtcurrent_derivatives) is exact and evaluates all of the derivatives together, which is usually faster than'numerical'(finite differences, 2 * num_n calls to the tunneling current function, with a forward step ofDV). With a DC bias network, the derivatives with respect to the DC voltages are always forward differences.vb_initial (ndarray, optional) – With a DC bias network: initial guess of the DC voltages,
vb[j, i], default iscct.vb
- Returns:
junction voltage that satisfies the circuit (mode ‘o’); also the number of iterations and whether the solution converged (mode ‘x’), or a mask of the converged bias voltages (mode ‘m’). With a DC bias network, the DC voltages
vb[j, i]follow the junction voltage (e.g.,vj, vbfor mode ‘o’, orvj, vb, iterations, convergedfor mode ‘x’).- Return type:
ndarray
3.5. qmix.network module
This module contains a class for linear networks described by scattering parameters (S-parameters), e.g., from electromagnetic simulations (HFSS) or measurements (VNA), and functions to read them from Touchstone files.
Description:
QMix describes the embedding circuit of the junction by its Thevenin equivalent at each frequency (
qmix.circuit.EmbeddingCircuit). TheNetworkclass here is a way to get there from a more detailed description of the circuit: S-parameter networks can be connected to each other (Network.connect) and terminated (Network.terminate), and the impedance seen at one of the ports (e.g., the port where the junction sits) follows fromNetwork.impedance.embedding_impedancewraps this into a function of frequency, including the junction’s capacitance, which can be used for the embedding impedances at the sidebands (e.g.,qmix.exp.PumpedData.mixer_noise).theveninalso gives the Thevenin voltage when a source (e.g., the LO) drives another port, andset_theveninputs both into aqmix.circuit.EmbeddingCircuit, so that the S-parameters drive the harmonic balance directly. With a list of junction ports, both give the multi-port Thevenin equivalent for several junctions (qmix.circuit.MultiJunctionCircuit).Typical workflow (an RF tuning circuit with the junction at port 1, the RF input at port 2 and the IF output at port 3):
tuner = read_touchstone('tuner.s3p') finline = read_touchstone('finline.s2p') rf = tuner.connect(2, finline, 2) # ports: junction, IF, waveguide z_emb = embedding_impedance(rf, 1, cap=120e-15, terminations={3: 288.}) z_emb(230e9) # in ohms # LO with an available power of 50 nW at the waveguide port (port 3) cct = EmbeddingCircuit(1, 1, vgap=2.7e-3, rn=14.) cct.freq[1] = 230e9 / cct.fgap set_thevenin(cct, rf, f=1, p=1, port=1, source_port=3, power=50e-9, cap=120e-15, terminations={2: 50.})
Note
Waves and reference impedances. The S-parameters are defined with
power waves (Kurokawa, 1965), a = (V + Z_ref I) / (2 sqrt(Re Z_ref))
and b = (V - Z_ref^* I) / (2 sqrt(Re Z_ref)), with one reference
impedance per port and frequency. For real reference impedances (the
usual case), these are the usual traveling waves. Network.renormalize
changes the reference impedances.
Ports are numbered from 1, as in Touchstone files. Frequencies are in [Hz] and impedances in [ohms] (not normalized), since these networks come from outside of QMix.
Circuit elements. Besides Touchstone files, networks can be built
from SuperMix’s passive elements (all checked against SuperMix): lines
(transmission_line, ideal_line, microstrip_line,
cpw_line, rectangular_waveguide_line, radial_stub), lumped
elements in series or shunt (resistor, capacitor, inductor,
series_rlc, parallel_rlc, series_impedance,
shunt_impedance; via_inductance), connections (tee,
series_tee) and terminations (load), and ideal components
(attenuator, time_delay, transformer, circulator,
hybrid90, hybrid180, power_divider, slot_antenna,
twin_slot_antenna), plus deembed. Unlike in SuperMix, elements
don’t have their own temperatures: the thermal noise of a lossy network
(qmix.small_signal) is calculated from its impedance matrix at one
temperature.
- class qmix.network.Network(freq, s, z0=50.0)
Bases:
objectLinear network described by its S-parameters.
- Parameters:
freq (ndarray) – Frequencies, in [Hz]
s (ndarray) – S-parameters,
s[k, i, j]= S_(i+1)(j+1) at frequencyfreq[k]z0 (complex or ndarray, optional) – Reference impedances, in [ohms]: a scalar, one value per port, or one value per frequency and port (
z0[k, i]); default is 50
- connect(port, other, other_port)
Connect a port of this network to a port of another network.
Both networks must have the same frequencies (see
Network.interpolate). The reference impedances of the two connected ports don’t need to be equal.- Parameters:
port (int) – Port of this network (starting from 1)
other (Network) – Other network
other_port (int) – Port of the other network (starting from 1)
- Returns:
combined network; its ports are the remaining ports of this network followed by the remaining ports of the other network, each in their original order
- Return type:
- copy()
Copy of the network.
- impedance(port=1, terminations=None)
Impedance seen looking into one port, with the other ports terminated.
- Parameters:
port (int, optional) – Port (starting from 1), default is 1
terminations (dict, optional) – Load impedances of the other ports, in [ohms], as
{port: z_load}(each a scalar or one value per frequency); ports that are not listed are matched (terminated by their reference impedance, i.e., no reflection)
- Returns:
Impedance at each frequency, in [ohms]
- Return type:
ndarray
- interpolate(freq)
Network at other frequencies, by cubic-spline interpolation of the S-parameters and reference impedances.
- Parameters:
freq (ndarray) – New frequencies, in [Hz], within the range of the current ones
- Returns:
interpolated network
- Return type:
- property num_ports
Number of ports.
- reflection(port=1, terminations=None)
Reflection coefficient at one port (with respect to its reference impedance), with the other ports terminated (see
Network.impedance).
- renormalize(z0)
Network with new reference impedances.
- Parameters:
z0 (complex or ndarray) – New reference impedances, in [ohms]: a scalar, one value per port, or one value per frequency and port
- Returns:
renormalized network
- Return type:
- terminate(port, z_load)
Network with one port terminated by a load impedance.
- Parameters:
port (int) – Port to terminate (starting from 1)
z_load (complex or ndarray) – Load impedance, in [ohms]; a scalar or one value per frequency (
np.inffor an open circuit)
- Returns:
network without this port (the other ports keep their order)
- Return type:
- qmix.network.attenuator(freq, db, z0=50.0)
Matched attenuator (SuperMix’s
attenuator):S21 = S12 = 10^(-dB / 20).- Parameters:
freq (ndarray) – Frequencies, in [Hz]
db (float) – Attenuation, in [dB]
z0 (float, optional) – Reference impedance, in [ohms]; default is 50
- Returns:
2-port network
- Return type:
- qmix.network.capacitor(freq, c, shunt=False, z0=50.0)
Capacitor in series (default) or in parallel (
shunt=True) with a 2-port (SuperMix’scapacitor).- Parameters:
freq (ndarray) – Frequencies, in [Hz]
c (float) – Capacitance, in [F]
shunt (bool, optional) – Parallel instead of series, default is False
z0 (float, optional) – Reference impedance, in [ohms]; default is 50
- Returns:
2-port network
- Return type:
- qmix.network.circulator(freq, z0=50.0)
Ideal 3-port circulator, 1 -> 2 -> 3 -> 1 (SuperMix’s
circulator).- Parameters:
freq (ndarray) – Frequencies, in [Hz]
z0 (float, optional) – Reference impedance, in [ohms]; default is 50
- Returns:
3-port network
- Return type:
- qmix.network.cpw(freq, width, space, height, eps_r, backed=False)
Characteristic impedance and propagation constant of a lossless coplanar waveguide (SuperMix’s
cpw).Quasi-static conformal mapping (Bahl & Bhartia), on a substrate of finite thickness, without or with a conducting backing. The ratio of the complete elliptic integrals
K(k) / K'(k)uses Hilberg’s approximation, and the free-space impedance is approximated as120 piohms, as in SuperMix. Conductor and dielectric losses (and the kinetic inductance of superconductors) are not included.- Parameters:
freq (ndarray) – Frequencies, in [Hz]
width (float) – Width of the center conductor, in [m]
space (float) – Gap between the center conductor and the ground planes, in [m]
height (float) – Thickness of the substrate, in [m]
eps_r (float) – Relative permittivity of the substrate
backed (bool, optional) – Conducting plane below the substrate, default is False
- Returns:
- characteristic impedance
zcin [ohms] and propagation constant
gammain [1/m], one value per frequency (scalars for a scalarfreq)
- characteristic impedance
- Return type:
tuple
- qmix.network.cpw_line(freq, length, width, space, height, eps_r, backed=False, z0=None)
Coplanar waveguide section (lossless; see
cpw).- Parameters:
freq (ndarray) – Frequencies, in [Hz]
length (float) – Length, in [m]
width – see
cpwspace – see
cpwheight – see
cpweps_r – see
cpwbacked – see
cpwz0 (complex or ndarray, optional) – Reference impedances, see
transmission_line
- Returns:
2-port network
- Return type:
- qmix.network.deembed(measured, input, output, z0=50.0)
De-embed a 2-port from a measurement that includes known input and output 2-ports (SuperMix’s
deembed):measured = input -- dut -- output
The 2-ports are combined as ABCD (chain) matrices:
dut = input^-1 measured output^-1.- Parameters:
- Returns:
the device, a 2-port network
- Return type:
- qmix.network.embedding_impedance(network, port=1, cap=0.0, terminations=None)
Embedding impedance seen by a junction at one port of a network, as a function of frequency.
The impedance looking into
port(Network.impedance) is in parallel with the junction capacitancecap(the capacitance is part of the embedding circuit in QMix, which only simulates the tunneling current). Between the frequencies of the network, the reflection coefficient at the port is interpolated with a cubic spline (it is bounded and smoother than the impedance).- Parameters:
network (Network) – Network
port (int, optional) – Port of the junction (starting from 1), default is 1
cap (float, optional) – Junction capacitance, in [F], default is 0
terminations (dict, optional) – Load impedances of the other ports, see
Network.impedance
- Returns:
embedding impedance in [ohms] as a function of frequency in [Hz] (scalar or array)
- Return type:
function
- qmix.network.hybrid180(freq, z0=50.0)
Ideal 180 degree hybrid coupler (SuperMix’s
hybrid180):S12 = S13 = S34 = 1 / sqrt(2),S24 = -1 / sqrt(2); 1 and 4, and 2 and 3, are isolated.- Parameters:
freq (ndarray) – Frequencies, in [Hz]
z0 (float, optional) – Reference impedance, in [ohms]; default is 50
- Returns:
4-port network
- Return type:
- qmix.network.hybrid90(freq, z0=50.0)
Ideal 90 degree hybrid coupler (SuperMix’s
hybrid90): ports 1 and 2, and 3 and 4, are coupled with-j / sqrt(2), ports 1 and 3, and 2 and 4, with-1 / sqrt(2); 1 and 4, and 2 and 3, are isolated.- Parameters:
freq (ndarray) – Frequencies, in [Hz]
z0 (float, optional) – Reference impedance, in [ohms]; default is 50
- Returns:
4-port network
- Return type:
- qmix.network.ideal_line(freq, zc, theta, f_ref, loss=0.0, z0=None)
Transmission line from its electrical length at a reference frequency (SuperMix’s
trline).The phase length is
theta * freq / f_ref, and the line loses the fractionlossof the power per wavelength.- Parameters:
freq (ndarray) – Frequencies, in [Hz]
zc (complex) – Characteristic impedance, in [ohms]
theta (float) – Electrical length at
f_ref, in [radians]f_ref (float) – Reference frequency, in [Hz]
loss (float, optional) – Fraction of the power lost per wavelength (0 <= loss < 1), default is 0
z0 (complex or ndarray, optional) – Reference impedances, see
transmission_line
- Returns:
2-port network
- Return type:
- qmix.network.impedance_matrix(network, freq, ports, cap=0.0, terminations=None)
Impedance matrix of several ports of a network, with the other ports terminated.
V = Z Ifor the voltages and currents (into the network) atports. With power waves,Z = F^-1 (1 - S)^-1 (S G + G^*) Ffrom the S-matrix of these ports (F = diag(1 / (2 sqrt(Re Z_ref))),G = diag(Z_ref)), interpolated with cubic splines. Capacitancescap(e.g., of the junctions) are in parallel with the ports:Z' = (1 + Z Y_c)^-1 ZwithY_c = diag(j w cap). This gives the embedding networks of several junctions for the small-signal analysis (qmix.small_signal.sideband_networks), with the junction ports and one external port (withcap = 0).The ports need reference impedances with a positive real part; only the frequencies of the network where all of them do (e.g., a waveguide port above cutoff) are used.
- Parameters:
network (Network) – Network
freq (float or ndarray) – Frequency, in [Hz]
ports (list) – Ports (starting from 1)
cap (float or list, optional) – Capacitance in parallel with each port, in [F], default is 0
terminations (dict, optional) – Load impedances of the other ports, see
Network.impedance; unlisted ports are matched
- Returns:
Impedance matrix in [ohms], shape
freq.shape + (n, n)- Return type:
ndarray
- qmix.network.inductor(freq, l, shunt=False, z0=50.0)
Inductor in series (default) or in parallel (
shunt=True) with a 2-port (SuperMix’sinductor).- Parameters:
freq (ndarray) – Frequencies, in [Hz]
l (float) – Inductance, in [H]
shunt (bool, optional) – Parallel instead of series, default is False
z0 (float, optional) – Reference impedance, in [ohms]; default is 50
- Returns:
2-port network
- Return type:
- qmix.network.load(freq, z, z0=50.0)
One-port load (SuperMix’s
zterm;ytermisload(freq, 1 / y)).- Parameters:
freq (ndarray) – Frequencies, in [Hz]
z (complex or ndarray) – Impedance, in [ohms] (
np.inffor an open circuit)z0 (float, optional) – Reference impedance, in [ohms]; default is 50
- Returns:
1-port network
- Return type:
- qmix.network.microstrip(freq, width, height, eps_r, thickness=None, strip=None, ground=None, temp=4.2, tan_d=0.0, eps_up=1.0, tan_up=0.0)
Characteristic impedance and propagation constant of a microstrip line, including the surface impedance of its conductors (e.g., superconducting films).
The quasi-static effective permittivity and the effect of the strip thickness are from Hammerstad & Jensen (1980), the dispersion from Kirschning & Jansen (1982), and the geometric factors for the characteristic impedance and the conductor surface impedances from Yassin & Withington (1995). This is the same model as SuperMix’s
microstripclass. The surface impedances add to the series impedance per unit length,Z = j k Z0 + g_strip Zs_strip + g_ground Zs_ground, which captures both the loss and the kinetic inductance of superconducting films.- Parameters:
freq (ndarray) – Frequencies, in [Hz]
width (float) – Width of the strip, in [m]
height (float) – Thickness of the dielectric between the strip and the ground plane, in [m]
eps_r (float) – Relative permittivity of the dielectric
thickness (float, optional) – Thickness of the strip, in [m]; default is the thickness of
stripstrip (film, optional) – Conductor of the strip: an object with a
zs(freq, temp)method returning the surface impedance in [ohms], e.g.,qmix.superconductor.SuperconductingFilm; default is a perfect conductorground (film, optional) – Conductor of the ground plane; default is a perfect conductor
temp (float, optional) – Temperature, in [K], passed to the films; default is 4.2
tan_d (float, optional) – Loss tangent of the dielectric
eps_up (float, optional) – Relative permittivity above the strip; default is 1 (vacuum)
tan_up (float, optional) – Loss tangent above the strip
- Returns:
- characteristic impedance
zcin [ohms] and propagation constant
gammain [1/m] (waves vary asexp(-gamma z)), one value per frequency (scalars for a scalarfreq)
- characteristic impedance
- Return type:
tuple
- qmix.network.microstrip_line(freq, length, width, height, eps_r, z0=None, **kwargs)
Microstrip transmission line (see
microstripfor the model).- Parameters:
freq (ndarray) – Frequencies, in [Hz]
length (float) – Length of the line, in [m]
width (float) – Width of the strip, in [m]
height (float) – Thickness of the dielectric, in [m]
eps_r (float) – Relative permittivity of the dielectric
z0 (complex or ndarray, optional) – Reference impedances of the two ports, in [ohms]; default is the real part of the characteristic impedance
kwargs – Other arguments of
microstrip:thickness,strip,ground,temp,tan_d,eps_up,tan_up
- Returns:
2-port network
- Return type:
- qmix.network.parallel_rlc(freq, r=inf, l=inf, c=0.0, shunt=False, z0=50.0)
Parallel RLC circuit,
Y = 1 / R + j w C + 1 / (j w L), in series (default) or in parallel (shunt=True) with a 2-port (SuperMix’sparallel_RLC).- Parameters:
freq (ndarray) – Frequencies, in [Hz]
r (float, optional) – Resistance, in [ohms], default is
np.inf(no resistor)l (float, optional) – Inductance, in [H], default is
np.inf(no inductor)c (float, optional) – Capacitance, in [F], default is 0
shunt (bool, optional) – Parallel instead of series, default is False
z0 (float, optional) – Reference impedance, in [ohms]; default is 50
- Returns:
2-port network
- Return type:
- qmix.network.power_divider(freq, z0=50.0)
Ideal in-phase power divider (SuperMix’s
power_divider):S12 = S13 = 1 / sqrt(2), all ports matched, ports 2 and 3 isolated.It is lossy (an internal, antisymmetric-mode port is terminated by
z0), so it has no impedance matrix.- Parameters:
freq (ndarray) – Frequencies, in [Hz]
z0 (float, optional) – Reference impedance, in [ohms]; default is 50
- Returns:
3-port network
- Return type:
- qmix.network.radial_stub(freq, radius, angle, length, width, height, eps_r, num_sections=15, z0=None, **kwargs)
Microstrip radial stub, fed by a microstrip line (SuperMix’s
radial_stub).The stub is modeled as
num_sectionsmicrostrip sections (annular slices of equal length, each as wide as the arc at its middle), starting at the radiusr0 = width / sqrt(2 angle tan(angle / 2))where the area of the feed line equals that of the sector it overlaps. Port 1 is the end of the feed line, port 2 the outer edge of the stub (usually left open:terminate(2, np.inf)).- Parameters:
freq (ndarray) – Frequencies, in [Hz]
radius (float) – Outer radius of the stub, in [m]
angle (float) – Opening angle, in [radians] (between 0 and pi)
length (float) – Length of the feed line, in [m]
width (float) – Width of the feed line, in [m]
height (float) – Thickness of the dielectric, in [m]
eps_r (float) – Relative permittivity of the dielectric
num_sections (int, optional) – Number of sections, default is 15
z0 (complex or ndarray, optional) – Reference impedances of the two ports, in [ohms]; default is the real part of the characteristic impedance of the feed line (port 1) and of the last section (port 2)
kwargs – Other arguments of
microstrip:thickness,strip,ground,temp,tan_d,eps_up,tan_up
- Returns:
2-port network
- Return type:
- qmix.network.read_touchstone(filename, num_ports=None)
Read a Touchstone file (version 1, S-parameters).
Supports the frequency units Hz/kHz/MHz/GHz, the formats MA, DB and RI, and the reference impedance from the option line (
R). If the option line has noRand the file has one! Port Impedancecomment per frequency (as written by HFSS for files that are not renormalized), these port impedances are used as the reference impedances.- Parameters:
filename (str) – File name; the extension (
.sNp) gives the number of portsnum_ports (int, optional) – Number of ports, if not given by the extension
- Returns:
network from the file
- Return type:
- qmix.network.rectangular_waveguide(freq, a, b, eps_r=1.0, tan_d=0.0, wall=None, temp=4.2)
Characteristic impedance and propagation constant of the TE10 mode of a rectangular waveguide (SuperMix’s
r_waveguide).The characteristic impedance is the power-voltage impedance,
Zc = 2 b / a Z_TE(Z_TE: wave impedance). Above cutoff, the losses of the walls (from the real part of their surface impedance) and of the dielectric filling are included to first order; below cutoff, the mode is evanescent (realgamma, imaginaryZc) and the losses are ignored.- Parameters:
freq (ndarray) – Frequencies, in [Hz]
a (float) – Broad dimension, in [m]
b (float) – Narrow dimension, in [m]
eps_r (float, optional) – Relative permittivity of the filling, default is 1 (vacuum)
tan_d (float, optional) – Loss tangent of the filling, default is 0
wall (film, optional) – Conductor of the walls (
zs(freq, temp)method, e.g.,qmix.superconductor.NormalFilm); default is a perfect conductortemp (float, optional) – Temperature, in [K], passed to the wall; default is 4.2
- Returns:
- characteristic impedance
zcin [ohms] and propagation constant
gammain [1/m] (waves vary asexp(-gamma z)), one value per frequency (scalars for a scalarfreq)
- characteristic impedance
- Return type:
tuple
- qmix.network.rectangular_waveguide_line(freq, length, a, b, z0=None, **kwargs)
Rectangular waveguide section (TE10; see
rectangular_waveguide).- Parameters:
freq (ndarray) – Frequencies, in [Hz]
length (float) – Length, in [m]
a (float) – Broad dimension, in [m]
b (float) – Narrow dimension, in [m]
z0 (complex or ndarray, optional) – Reference impedances, see
transmission_linekwargs – Other arguments of
rectangular_waveguide:eps_r,tan_d,wall,temp
- Returns:
2-port network
- Return type:
- qmix.network.resistor(freq, r, shunt=False, z0=50.0)
Resistor in series (default) or in parallel (
shunt=True) with a 2-port (SuperMix’sresistor; seeseries_impedance).- Parameters:
freq (ndarray) – Frequencies, in [Hz]
r (float) – Resistance, in [ohms]
shunt (bool, optional) – Parallel instead of series, default is False
z0 (float, optional) – Reference impedance, in [ohms]; default is 50
- Returns:
2-port network
- Return type:
- qmix.network.series_impedance(freq, z, z0=50.0)
Impedance in series between two ports (SuperMix’s
spimpin series mode):1 o--[ Z ]--o 2 o---------o
- Parameters:
freq (ndarray) – Frequencies, in [Hz]
z (complex or ndarray) – Impedance, in [ohms] (scalar or one value per frequency;
np.inffor an open circuit)z0 (float, optional) – Reference impedance of both ports, in [ohms]; default is 50
- Returns:
2-port network
- Return type:
- qmix.network.series_rlc(freq, r=0.0, l=0.0, c=inf, shunt=False, z0=50.0)
Series RLC circuit,
Z = R + j w L + 1 / (j w C), in series (default) or in parallel (shunt=True) with a 2-port (SuperMix’sseries_RLC).- Parameters:
freq (ndarray) – Frequencies, in [Hz]
r (float, optional) – Resistance, in [ohms], default is 0
l (float, optional) – Inductance, in [H], default is 0
c (float, optional) – Capacitance, in [F], default is
np.inf(no capacitor;c = 0is an open circuit)shunt (bool, optional) – Parallel instead of series, default is False
z0 (float, optional) – Reference impedance, in [ohms]; default is 50
- Returns:
2-port network
- Return type:
- qmix.network.series_tee(freq, z0=50.0)
Ideal series connection of three ports (SuperMix’s
series_tee):1 o-------------+ o----+ | | +---o 3 o----+ +---o 2 o-------------+
The current of port 3 flows through ports 1 and 2 in series, and the voltage of port 3 is the sum of the voltages of ports 1 and 2. The ports are not equivalent. With the same real reference at all ports, the S-matrix doesn’t depend on it.
- Parameters:
freq (ndarray) – Frequencies, in [Hz]
z0 (float, optional) – Reference impedance of all ports, in [ohms]; default is 50
- Returns:
3-port network
- Return type:
- qmix.network.set_thevenin(cct, network, f=1, p=1, port=1, source_port=None, power=0.0, phase=0.0, cap=0.0, terminations=None)
Set the embedding circuit of one tone and harmonic from a network.
The Thevenin voltage and impedance (
thevenin) at the frequency of tonefand harmonicp(p * cct.freq[f], de-normalized with the gap frequency) are normalized and stored incct.vt[f, p]andcct.zt[f, p]. The gap voltage and normal resistance ofcctmust be set.For several junctions (
qmix.circuit.MultiJunctionCircuit),portis a list with the port of each junction (in the order of the junctions), andcct.vt[:, f, p]andcct.zt[:, :, f, p]are set.- Parameters:
cct (qmix.circuit.EmbeddingCircuit) – Embedding circuit (modified), or
qmix.circuit.MultiJunctionCircuitnetwork (Network) – Network
f (int, optional) – Tone, default is 1
p (int, optional) – Harmonic, default is 1
port – see
theveninsource_port – see
theveninpower – see
theveninphase – see
thevenincap – see
theveninterminations – see
thevenin
- Returns:
Thevenin voltage and impedance (normalized)
- Return type:
tuple
- qmix.network.shunt_impedance(freq, z, z0=50.0)
Impedance in parallel across a 2-port (SuperMix’s
spimpin parallel mode):1 o----+----o 2 [Z] o----+----o
- Parameters:
freq (ndarray) – Frequencies, in [Hz]
z (complex or ndarray) – Impedance, in [ohms] (
np.inffor an open circuit, i.e., no element)z0 (float, optional) – Reference impedance of both ports, in [ohms]; default is 50
- Returns:
2-port network
- Return type:
- qmix.network.slot_antenna(freq, z, z0=50.0)
Slot antenna with impedance
z(SuperMix’sslot_antenna).Port 1 is the RF input; ports 2 and 3 are the out-of-phase and in-phase outputs. Driven from a source with impedance
z0at port 1, the antenna presents the impedancezbetween ports 2 and 3 (an ideal transformer fromz0tozin series with the outputs):1 (z0) | transformer | (z) 2 o-------+ +-------o 3 o-------------------o
- Parameters:
freq (ndarray) – Frequencies, in [Hz]
z (complex or ndarray) – Antenna impedance, in [ohms]
z0 (float, optional) – Reference impedance, in [ohms]; default is 50
- Returns:
3-port network
- Return type:
- qmix.network.tee(freq, z0=50.0, num_ports=3)
Ideal junction of several ports at one node (e.g., a tee).
All ports have the same voltage and their currents add to zero. With the same real reference impedance at all ports,
S = 2 / N - 1.- Parameters:
freq (ndarray) – Frequencies, in [Hz]
z0 (float, optional) – Reference impedance of all ports, in [ohms] (real); default is 50
num_ports (int, optional) – Number of ports; default is 3
- Returns:
network with
num_portsports- Return type:
- qmix.network.thevenin(network, freq, port=1, source_port=None, power=0.0, phase=0.0, cap=0.0, terminations=None)
Thevenin equivalent circuit seen by a junction at one port of a network, with a source at another port.
The source (e.g., the LO, coupled through the waveguide) has an internal impedance equal to the reference impedance of
source_port(so it doesn’t reflect the wave leaving the network) and an available power ofpower. The Thevenin impedance is the embedding impedance (embedding_impedance), and the Thevenin voltage is the open-circuit voltage atport. With power waves, an incident wavea_sat the source port (|a_s|^2 / 2 = power, peak amplitudes) givesV_T = 2 sqrt(Re Z_ref) S_js a_s / (1 - S_jj)at the junction port j, from the S-matrix of the two ports with all other ports terminated. The junction capacitancecapis in parallel with the junction port:V_TandZ_Tare both divided by1 + j w cap Z_T.The S-parameters are interpolated between the frequencies of the network with cubic splines (the reflection coefficient, as in
embedding_impedance, and the transmission coefficient).Several junctions: if
portis a list of ports (one per junction), the result is the multi-port Thevenin equivalent: the open-circuit voltages at all junction ports (a vector) and the impedance matrix of those ports (withV = Z I,Iinto the network), as used byqmix.circuit.MultiJunctionCircuit. From the S-matrix of the junction ports,Z = F^-1 (1 - S)^-1 (S G + G^*) FwithF = diag(1 / (2 sqrt(Re Z_ref)))andG = diag(Z_ref), and the open-circuit voltages areV_T = 2 sqrt(Re Z_ref) (1 - S_JJ)^-1 S_Js a_s.capcan then be one capacitance per junction; the capacitances are in parallel with the junction ports:(1 + Z Y_c)^-1multiplies bothZandV_T, withY_c = diag(j w cap). The junction ports need reference impedances with a positive real part.- Parameters:
network (Network) – Network
freq (float or ndarray) – Frequency, in [Hz]
port (int or list, optional) – Port of the junction (starting from 1), or a list of ports for several junctions, default is 1
source_port (int, optional) – Port of the source; default is None (no source:
V_T = 0, e.g., for the IF, or for harmonics)power (float, optional) – Available power of the source, in [W], default is 0
phase (float, optional) – Phase of the source, in [rad], default is 0
cap (float or list, optional) – Junction capacitance, in [F] (or one per junction), default is 0
terminations (dict, optional) – Load impedances of the other ports (not
portorsource_port), seeNetwork.impedance; unlisted ports are matched
- Returns:
Thevenin voltage (peak amplitude, in [V]) and Thevenin impedance (in [ohms]) at each frequency; for a list of ports, with shapes
freq.shape + (num_j,)andfreq.shape + (num_j, num_j)- Return type:
tuple
- qmix.network.time_delay(freq, delay, z0=50.0)
Matched, lossless time delay (SuperMix’s
time_delay):S21 = S12 = exp(-j 2 pi f delay).- Parameters:
freq (ndarray) – Frequencies, in [Hz]
delay (float) – Delay, in [s]
z0 (float, optional) – Reference impedance, in [ohms]; default is 50
- Returns:
2-port network
- Return type:
- qmix.network.transformer(freq, z1, z2, z0=50.0)
Ideal lossless transformer from
z1(port 1) toz2(port 2) (SuperMix’stransformer).A lossless, reciprocal 2-port: with port 2 terminated by
z2^*, port 1 presents the impedancez1, and with port 1 terminated byz1^*, port 2 presentsz2. Forz1 = r1 + j x1andz2 = r2 + j x2,S11 = (zeta + j psi) / D,S22 = (-zeta + j psi) / DandS12 = S21 = 1 / D, wherezeta = (s - 1 / s) / 2,psi = (x2 s + x1 / s) / 2,D = sqrt(1 + zeta^2) + j psiands = sqrt(r1 / r2)(withrandxnormalized toz0). For realz1andz2, it is an ideal transformer with the impedance ratioz1 / z2.- Parameters:
freq (ndarray) – Frequencies, in [Hz]
z1 (complex) – Impedance at port 1, in [ohms] (positive real part)
z2 (complex) – Impedance at port 2, in [ohms] (positive real part)
z0 (float, optional) – Reference impedance, in [ohms]; default is 50
- Returns:
2-port network
- Return type:
- qmix.network.transmission_line(freq, zc, gamma, length, z0=None)
Transmission line from its characteristic impedance and propagation constant.
Waves on the line vary as
exp(-gamma z), sogamma = alpha + j beta(alpha: attenuation,beta: phase constant; for an ideal line,gamma = j 2 pi f sqrt(eps_eff) / c).- Parameters:
freq (ndarray) – Frequencies, in [Hz]
zc (complex or ndarray) – Characteristic impedance, in [ohms] (scalar or one value per frequency)
gamma (complex or ndarray) – Propagation constant, in [1/m] (scalar or one value per frequency)
length (float) – Length of the line, in [m]
z0 (complex or ndarray, optional) – Reference impedances of the two ports, in [ohms] (as for
Network); default is the real part ofzc, so that a lossless line is matched (S21 = exp(-gamma length),S11 = 0), or|zc|wherezcis purely reactive (e.g., a waveguide below cutoff)
- Returns:
2-port network
- Return type:
- qmix.network.twin_slot_antenna(antenna)
Twin-slot antenna with symmetric excitation (SuperMix’s
twin_slot_antenna).Port 1 is the RF input; ports 2 and 3 are the out-of-phase and in-phase outputs of antenna 1, ports 4 and 5 those of antenna 2. The antisymmetric mode is terminated internally (matched), so the network is lossy.
- Parameters:
antenna (Network) – Response of the antenna pair: a 2-port (
S11the self-,S12the mutual reflection, assumed reciprocal and symmetric) or a 1-port (no coupling between the antennas), with one real reference impedance at all frequencies and ports, which is also the reference of the result- Returns:
5-port network
- Return type:
- qmix.network.via_inductance(diameter, height)
Inductance of a via hole to ground (Goldfarb & Pucel 1991; SuperMix’s
L_via).L = mu_0 / (2 pi) [h ln((h + sqrt(r^2 + h^2)) / r) + 3 / 2 (r - sqrt(r^2 + h^2))], withr = diameter / 2. The formula was fitted for 0.2 < D / h < 1.5, 100 um < h < 635 um and 2.2 < eps_r < 20; a warning is issued outside of the geometric ranges.- Parameters:
diameter (float) – Diameter of the hole, in [m]
height (float) – Height of the hole (substrate thickness), in [m]
- Returns:
Inductance, in [H] (e.g., for
inductor(..., shunt=True))- Return type:
float
- qmix.network.waveguide_cutoff(a, eps_r=1.0)
Cutoff frequency of the TE10 mode of a rectangular waveguide, in [Hz].
- Parameters:
a (float) – Broad dimension, in [m]
eps_r (float, optional) – Relative permittivity of the filling
3.6. qmix.qtcurrent module
This module contains functions to calculate the quasiparticle tunneling currents passing through an SIS junction.
Description:
Given the voltages applied across an SIS junction, the quasiparticle tunneling currents can be calculated using multi-tone spectral domain analysis (MTSDA; see references in online docs).
Two methods are available for the summation over the phase factor coefficients (Eqn. 5.25 in Kittara’s thesis):
'direct': the response function is interpolated at every combination of the summation indices (interpolate_respfn), and the sum is evaluated directly. The size of this matrix, and the time per current calculation, scale with the product of (2 * num_b + 1) over all tones.
'fourier': the response function is represented by a (windowed) Fourier series, so that the shift in its argument factorizes into one term per tone. The cost then scales with the sum of (2 * num_b + 1) over all tones, and no large matrix is needed. This makes 5+ tones (or largenum_b) tractable. The accuracy is limited by the smoothness of the response function splines: ~1e-7 (relative to the direct method) with the default cubic splines, ~1e-9 or better withspline_order=5(seeqmix.respfn.RespFn). It is not suitable forRespFnPerfectwithout smearing.By default (
method='auto'), the direct method is used unless the interpolated response function matrix would be larger thanMAX_RESP_MATRIX_BYTES.The current at an output frequency is the sum over all combinations of tone indices (a_1, …, a_F) with a_1 * f_1 + … + a_F * f_F equal to that frequency (Eqn. 5.36). All combinations with
|a_f| <= num_pare included. When the tones are commensurate (e.g., LO, USB, LSB and IF), combinations with larger indices can also land on the output frequency, some of them first order in the signals (e.g., 2 * LO - LSB = USB). These are included if an upper bound on their contribution exceedsMIXING_TOLtimes the size of that current (seeqtcurrent).
Note
This code is largely based on P. Kittara’s 2002 DPhil thesis (see references in online docs). I include some inline comments to refer to specific equations.
Also, all of the values in this module are normalized, i.e., voltages are normalized to the gap voltage, frequencies are normalized to the gap frequency, etc.
- class qmix.qtcurrent.FourierResp(resp, vb, freq, nb_list, num_modes=None)
Bases:
objectFourier representation of the response function, for the Fourier-shift method (see module docstring).
The response function is multiplied by a smooth window that is exactly one over every voltage that the direct method would interpolate (the bias voltages plus all combinations of the summation indices), tapered to zero over
FOURIER_TAPERon either side, and then represented by a Fourier series over that period. Within the window, the only approximation is the truncation of the series tonum_modeson each side of zero.Instances are returned by
interpolate_respfnand are passed toqtcurrentasresp_matrix. They depend on the response function, the bias voltages, the frequencies andnum_b, but not on the junction voltage, so they can be reused in the same way as the response function matrix.- Parameters:
resp (qmix.respfn.RespFn) – Response function
vb (ndarray) – Bias voltages, normalized
freq (ndarray) – Frequencies, normalized (1-indexed)
nb_list (tuple) – Summation limits for phase factor coefficients, one for each tone
num_modes (int, optional) – Number of Fourier modes on each side of zero, default is
NUM_MODES
- coeff
Fourier coefficients c_n
- Type:
ndarray
- tau
Angular “frequencies” (in 1/voltage) of the modes, tau_n = 2 pi n / period
- Type:
ndarray
- v0
Start of the period
- Type:
float
- period
Length of the period (in normalized voltage)
- Type:
float
- vb
Bias voltages
- Type:
ndarray
- shift
Per-tone shift matrices exp(j * tau_n * k * freq_f), with shape (num_coeff, 2 * num_b_f + 1), using wraparound indexing for k
- Type:
list
- bias_phase(modes=slice(None, None, None))
Fourier coefficients times the phase factors of the bias voltages, i.e., c_n * exp(j * tau_n * (vb - v0)).
- Parameters:
modes (slice, optional) – Subset of the modes, default is all
- Returns:
With shape (number of modes, npts)
- Return type:
ndarray
- resp(voltage)
Evaluate the Fourier series (i.e., the represented response function). Only accurate within the window.
- Parameters:
voltage (ndarray) – Voltage, normalized
- Returns:
Response function
- Return type:
ndarray
- qmix.qtcurrent.calculate_phase_factor_coeff(vj, freq, num_f, num_p, num_b)
Calculate the overall phase factor spectrum coefficients.
Runs once per qtcurrent function call.
Eqns. 5.7 and 5.12 in Kittara’s thesis.
- Parameters:
vj (ndarray) – Voltage across the SIS junction
freq (ndarray) – Frequencies
num_f (int) – Number of non-harmonically related frequencies
num_p (int) – Number of harmonics
num_b (int) – Summation limits for phase factor coefficients
- Returns:
Phase factor spectrum coefficients (C_k(H) in Kittara)
- Return type:
ndarray
- qmix.qtcurrent.interpolate_respfn(cct, resp, num_b, method='auto', num_modes=None, verbose=False)
Interpolate the response function at all necessary voltages.
I have included this as a stand-alone function because if you are going to be running
qtcurrentover and over again with the same input signal frequencies, it can save time by pre-interpolating the response function.For the Fourier-shift method (see module docstring), this returns a
FourierRespobject instead of a matrix. Either can be passed toqtcurrentasresp_matrix.- Parameters:
cct (qmix.circuit.EmbeddingCircuit) – Embedding circuit
resp (qmix.respfn.RespFn) – Response function
num_b (int/tuple) – Summation limits for phase factor coefficients
method (str, optional) –
'direct','fourier'or'auto', default is'auto'num_modes (int, optional) – Number of Fourier modes for the Fourier-shift method, default is
NUM_MODESverbose (bool, optional) – Print a notice if
'auto'selects the Fourier-shift method, default is False
- Returns:
The interpolated response function as a matrix (direct method) or as a Fourier representation (Fourier-shift method); a list of these (one per junction) for a
qmix.circuit.MultiJunctionCircuit- Return type:
ndarray/FourierResp
- qmix.qtcurrent.junction_resp(resp, num_j, gap_voltage=None)
Response function of each junction.
- Parameters:
resp (qmix.respfn.RespFn or list) – One response function for all junctions, or a list with one per junction (each normalized to the junction’s own gap voltage and normal-state resistance)
num_j (int) – Number of junctions
gap_voltage (ndarray, optional) – Gap voltage of each junction, relative to the normalizing gap voltage (e.g.,
cct.gap_voltageof aqmix.circuit.MultiJunctionCircuit); the response functions of junctions withgap_voltage != 1are wrapped inqmix.respfn.GapScaledRespFn
- Returns:
Response function of each junction (the same object for junctions with the same response function and gap voltage)
- Return type:
list
- qmix.qtcurrent.qtcurrent(vj, cct, resp, freq_list, num_b=15, verbose=True, resp_matrix=None, method='auto', num_modes=None, mixing_tol=None)
Calculate the quasiparticle tunneling current.
This function uses multi-tone spectral domain analysis (MTSDA; see references in online docs). The current is calculated based on the voltage applied across the junction (vj).
Note
This function will return the tunneling current for all of the frequencies listed in freq_list (normalized to the gap frequency). E.g., to solve for the dc tunneling current and the ac tunneling current at 230 GHz, the
freq_listwould be[0, 230e9 / fgap]wherefgapis the gap frequency.Any number of non-harmonically related tones is supported. See the module docstring for the two summation methods (
'direct'and'fourier').For several junctions (
qmix.circuit.MultiJunctionCircuit),vjhas the junction axis first (vj[j, f, p, i]),respcan be one response function or a list (one per junction), andresp_matrixa list frominterpolate_respfn. The currents are returned with the junction axis first, scaled by the relative area of each junction (cct.area).- Parameters:
vj (ndarray) – Voltage across the SIS junction
cct (qmix.circuit.EmbeddingCircuit) – Embedding circuit
resp (qmix.respfn.RespFn) – Response function
freq_list – Calculate the tunneling currents for these frequencies (normalized to the gap frequency)
num_b (float/tuple, optional) – Summation limits for phase factor coefficients, default is 15
verbose (bool, optional) – Print info to the terminal if true, default is True
resp_matrix (ndarray/FourierResp, optional) – The interpolated response function matrix (or its Fourier representation), generated by interpolate_respfn(), default is None. If given, it determines the method (
methodis ignored).method (str, optional) –
'direct','fourier'or'auto'(see module docstring), default is'auto'num_modes (int, optional) – Number of Fourier modes for the Fourier-shift method, default is
NUM_MODESmixing_tol (float, optional) – include combinations of tone indices with
|a_f| > num_pthat land on an output frequency if the upper bound on their contribution exceeds this times the size of that current (see module docstring), default isMIXING_TOL(1e-6, which gives relative errors of ~1e-7 or better). Larger values are faster for commensurate tones;np.infonly includes|a_f| <= num_p. To change it forharmonic_balance, setqmix.qtcurrent.MIXING_TOL.
- Returns:
Quasiparticle tunneling current
- Return type:
ndarray
- qmix.qtcurrent.qtcurrent_derivatives(vj, cct, resp, freq_list, num_b=15, resp_matrix=None, method='auto', mixing_tol=None)
Derivatives of the tunneling current with respect to the junction voltage (analytic).
The phase factor coefficients of a tone are shifted by its harmonics when the voltage of a harmonic changes (see
_phase_factor_derivatives), so the derivatives are given by the same sums as the current (Eqn. 5.25), with the pair products of one tone replaced by their derivatives. No derivatives of the response function are needed. All of the terms are evaluated together (in batches), so this is usually faster than finite differences, and it is exact (up to the truncation of the summation).- Parameters:
vj (ndarray) – Voltage across the SIS junction,
vj[f, p, i]cct (qmix.circuit.EmbeddingCircuit) – Embedding circuit
resp (qmix.respfn.RespFn) – Response function
freq_list – Output frequencies (normalized), as for
qtcurrentnum_b (int/tuple, optional) – Summation limits for phase factor coefficients, default is 15
resp_matrix (ndarray/FourierResp, optional) – Interpolated response function, from
interpolate_respfn(default: calculated here)method (str, optional) –
'direct','fourier'or'auto', ifresp_matrixis not givenmixing_tol (float, optional) – see
qtcurrent
- Returns:
Derivatives
d[o, f, p, c, i]of the current at output frequency o with respect to the real (c = 0) and imaginary (c = 1) part ofvj[f, p](tones and harmonics 1-indexed, as invj)- Return type:
ndarray
- qmix.qtcurrent.resp_matrix_size(nb_list)
Number of response function values per bias point for the direct method, i.e., the product of (2 * num_b + 1) over all tones.
- Parameters:
nb_list (tuple) – Summation limits, one for each tone
- Returns:
Number of values
- Return type:
int
- qmix.qtcurrent.suggest_num_b(vj, cct, tol=1e-05, max_b=50)
Suggest summation limits for the phase factor coefficients (num_b).
The computation time of
qtcurrent(and thereforeharmonic_balance) scales with the product of (2 * num_b + 1) over all tones, but weakly driven tones only need a few terms. This function calculates the phase factor coefficients for each tone and returns the smallest summation limit beyond which all coefficients are belowtol(at every bias voltage).Note
This requires the actual junction voltage (e.g., the output of
harmonic_balance), not the Thevenin voltage. Some tones (e.g., an IF tone) can have a large junction voltage even though they are not driven by the embedding circuit (i.e.,cct.vtis zero), because they are generated by mixing. A typical workflow is to runharmonic_balanceonce with a conservativenum_b, call this function, and then use the result for subsequent simulations with similar drive levels (e.g., sweeps).For several junctions (
qmix.circuit.MultiJunctionCircuit), the result is the largest limit of each tone over all junctions.- Parameters:
vj (ndarray) – Voltage across the SIS junction
cct (qmix.circuit.EmbeddingCircuit) – Embedding circuit
tol (float, optional) – Neglect phase factor coefficients smaller than this value, default is 1e-5
max_b (int, optional) – Largest summation limit to consider, default is 50
- Returns:
Suggested summation limits, one for each tone
- Return type:
tuple
3.7. qmix.respfn module
This module contains classes to represent the response function of the SIS junction.
There are several different types of response function classes:
Response functions generated directly from I-V data:
RespFn: This is the base class for all of the other response function classes. This class will generate a response function based on a DC I-V curve (i.e., DC voltage and current data). Note that this class assumes that you have “pre-processed” the data. This means that it will use the voltage and current data to generate the interpolation directly. Normally, you want to have more data points around curvier regions in order to minimize how much time the interpolation takes. If you haven’t done this, it is a good idea to useRespFnFromIVDatainstead.
RespFnFromIVData: This class will generate a response function based on a DC I-V curve (i.e., DC voltage and current data). UnlikeRespFn, this class will resample the response function in order to optimize the interpolation.Response functions generated from I-V curve models:
RespFnPerfect: This class will generate a response function based on an ideal DC I-V curve (i.e., the subgap current is exactly zero below the gap voltage and exactly equal to the bias voltage above the gap, assuming normalized values). This DC I-V curve has an infinitely sharp transition. Note however that you can smear the transition using thev_smearargument. This will convolve the ideal reasponse function with a Gaussian distribution, allowing you to control the sharpness of the transition.
RespFnPolynomial: This class will generate a response function based on the polynomial model from Kennedy (1999). The order of the polynomial controls the sharpness of the transition, so this class can be used to simulate the effect of the transition’s sharpness (e.g., how does the gain change when the gap is more or less sharp?).
RespFnExponential: This class will generate a response function based on the exponential model from Rashid et al. (2016). This model is very similar toRespFnPolynomial, except that you can include a leakage current (i.e., a finite subgap resistance).
Upon initialization, these classes will:
Load or calculate the DC I-V curve (which is the imagainary part of response function).
Calculate the Kramers-Kronig transform of the DC I-V curve (which is the real part of the response function).
Setup the density of the data points to optimize interpolation.
The response function needs enough data points that it can be interpolated accurately, but at the same time, not so many points that the interpolation takes too long.
Calculate cubic spline fits for the I-V curve and the KK transform.
Doing this once at the start allows the data to be interpolated very quickly later on.
Once initialized, the classes allow the user to interpolated the DC I-V curve, the KK transform, the derivative of the I-V curve, the derivative of the KK transform, and the response function (a complex value). These classes are optimized to interpolate very quickly.
Examples
For a quick example, we will generate a response function using the polynomial model, with polynomial order 50:
>>> resp = RespFnPolynomial(50, verbose=False)
You can then interpolate the DC I-V curve and the KK transform:
>>> bias_voltage = np.array([0.5, 1.0, 2.0])
>>> dc_current = resp.idc(bias_voltage)
>>> np.around(dc_current, 1)
array([0. , 0.5, 2. ])
>>> kk_current = resp.ikk(bias_voltage)
>>> np.around(kk_current, 1)
array([-0.5, 1.1, 0.1])
You can also interpolate the response function directly, which is a complex array:
>>> resp = resp(bias_voltage)
>>> np.around(resp, 1)
array([-0.5+0.j , 1.1+0.5j, 0.1+2.j ])
Here, the real part is the KK transform (same as the previous
kk_current results) and the imaginary part is the DC I-V curve (same as
the previous dc_current results).
- class qmix.respfn.GapScaledRespFn(resp, ratio)
Bases:
objectResponse function of a junction with a different gap voltage.
QMix normalizes all voltages in a circuit to one gap voltage (
vgap). A junction whose gap voltage isratio * vgap(e.g., one junction of aqmix.circuit.MultiJunctionCircuitwithgap_voltage[j] = ratio) has the response functionratio * resp(v / ratio)in these units, whererespis normalized to its own gap voltage and normal-state resistance. The current is then normalized tovgap / Rn_j; the normal-state conductance (area) is applied separately.Usually created by
qmix.qtcurrent.junction_resp, not directly.- Parameters:
resp (qmix.respfn.RespFn) – Response function, normalized to the junction’s own gap voltage and normal-state resistance
ratio (float) – Gap voltage of the junction, relative to the normalizing gap voltage
- didc(vbias)
Derivative of the DC I-V curve (see
RespFn.didc).
- dikk(vbias)
Derivative of the KK transform (see
RespFn.dikk).
- idc(vbias)
DC I-V curve (see
RespFn.idc).
- ikk(vbias)
KK transform of the DC I-V curve (see
RespFn.ikk).
- resp(vbias)
Call self as a function.
- class qmix.respfn.RespFn(voltage, current, **params)
Bases:
objectGenerate the response function from pre-processed I-V data.
This class expects “pre-processed” I-V data, meaning that there are more data points around the curvier regions of the I-V curve and fewer points in the linear regions. Sampling in this way helps the interpolation run as quick as possible.
If you have not “pre-processed” your data, please use
RespFnFromIVData.- Parameters:
voltage (ndarray) – normalized DC bias voltage
current (ndarray) – normalized DC tunneling current
- Keyword Arguments:
verbose (bool, default is True) – print info to terminal?
max_npts_dc (int, default is 101) – maximum number of points in DC I-V curve
max_npts_kk (int, default is 151) – maximum number of points in KK transform
max_interp_error (float, default is 0.001) – maximum interpolation error (in units of normalized current)
check_error (bool, default is False) – check interpolation error?
v_smear (float, default is None) – smear DC I-V curve by convolving with a Gaussian dist. with this std. dev.
kk_n (int, default is 50) – padding for Hilbert transform (see
qmix.mathfn.kktrans.kk_trans)spline_order (int, default is 3) – spline order for interpolations
- voltage
The DC bias voltage values.
- Type:
ndarray
- current
The DC tunneling current values.
- Type:
ndarray
- voltage_kk
The DC bias voltage values that correspond to
current_kk.- Type:
ndarray
- current_kk
The values of the KK transform of the DC I-V curve.
- Type:
ndarray
- v_max
The response function is only defined for
|voltage| <= v_max; beyond that, the splines are extrapolated, which is inaccurate.- Type:
float
- didc(vbias)
Interpolate the derivative of the DC I-V curve at the given bias voltage.
This is defined as
d(idc) / d(vb)whereidcis the DC tunneling current andvbis the bias voltage.Note
This method is not used directly by QMix, but it can be useful if you are calculating the tunneling currents using Tucker theory (see: Tucker and Feldman, 1985).
- Parameters:
vbias (ndarray) – Bias voltage (normalized)
- Returns:
derivative of the DC tunneling current
- Return type:
ndarray
- dikk(vbias)
Interpolate the derivative of the Kramers-Kronig transform.
This is defined as
d(ikk) / d(vb)whereikkis the Kramers- Kronig transform of the DC tunneling current andvbis the bias voltage.Note
This method is not used directly by QMix, but it can be useful if you are calculating the tunneling currents using Tucker theory (see: Tucker and Feldman, 1985).
- Parameters:
vbias (ndarray) – Bias voltage (normalized)
- Returns:
derivative of the KK transform of the DC I-V curve
- Return type:
ndarray
- idc(vbias)
Interpolate the DC I-V curve.
This is the imaginary component of the respones function, and it is used to calculate the quasiparticle tunneling currents in
qmix.qtcurrent.qtcurrent.- Parameters:
vbias (ndarray) – Bias voltage (normalized)
- Returns:
DC tunneling current
- Return type:
ndarray
- ikk(vbias)
Interpolate the Kramers-Kronig transform of the DC I-V curve at the given bias voltage.
This is the real component of the response function, and it is used to calculate the quasiparticle tunneling currents in
qmix.qtcurrent.qtcurrent.- Parameters:
vbias (ndarray) – Bias voltage (normalized)
- Returns:
KK transform of the DC I-V curve
- Return type:
ndarray
- plot(fig_name=None, ax=None)
Plot the response function.
This will plot the real and imaginary parts separately.
Note: If
fig_nameis provided, this method will save the plot to the specified folder and then close the plot. This means that the Matplotlib axis object will not be returned in this case. This is done to prevent too many plots from being open at the time.- Parameters:
fig_name (str, default is None) – name of figure file name, if you wish to save
ax (matplotlib.axes.Axes, default is None) – figure axis, if you would like to add to an existing figure
- Returns:
- figure axis (only if
fig_nameis None)
- figure axis (only if
- Return type:
matplotlib.axes.Axes
- plot_interpolation(fig_name=None, ax=None)
Plot the interpolation of the response function.
This can be used to check the interpolation of the response function. (Mostly just a sanity check.)
Note: If
fig_nameis provided, this method will save the plot to the specified folder and then close the plot. This means that the Matplotlib axis object will not be returned in this case. This is done to prevent too many plots from being open at the time.- Parameters:
fig_name (str, default is None) – name of figure file name, if you wish to save
ax (matplotlib.axes.Axes, default is None) – figure axis, if you would like to add to an existing figure
- Returns:
figure axis
- Return type:
matplotlib.axes.Axes
- resp(vbias)
Interpolate the response function.
- Parameters:
vbias (ndarray) – Bias voltage (normalized)
- Returns:
Response function (a complex value)
- Return type:
ndarray
- resp_conj(vbias)
Interpolate the complex conjugate of the response function.
Note
This method is not used directly by QMix, but it can be useful if you are calculating the tunneling currents using Tucker theory (see: Tucker and Feldman, 1985).
This method is included because it might be slightly faster than
np.conj(resp(vb))whererespis an instance of this class.- Parameters:
vbias (ndarray) – Bias voltage (normalized)
- Returns:
Complex conjugate of the response function
- Return type:
ndarray
- resp_swap(vbias)
Interpolate the response function, with the real and imaginary components swapped.
Note
This method is not used directly by QMix, but it can be useful if you are calculating the tunneling currents using Tucker theory (see: Tucker and Feldman, 1985).
This method is included because it might be slightly faster than
1j*np.conj(resp(vb))whererespis an instance of this class. This is the normal way that you would swap the real and imaginary components.- Parameters:
vbias (ndarray) – Bias voltage (normalized)
- Returns:
- Response function with the real and imaginary components
swapped
- Return type:
ndarray
- show_current(fig_name=None, ax=None)
Plot the interpolation of the response function.
This can be used to check the interpolation of the response function. (Mostly just a sanity check.)
Note: If
fig_nameis provided, this method will save the plot to the specified folder and then close the plot. This means that the Matplotlib axis object will not be returned in this case. This is done to prevent too many plots from being open at the time.Warning
This function is deprecated. Please use
plot_interpolationinstead. I renamed this function to be more consistent across the QMix package.- Parameters:
fig_name (string) – figure name if saved
ax – figure axis
- class qmix.respfn.RespFnExponential(vgap=0.0028, rn=14, rsg=1000, agap=40000.0, **kwargs)
Bases:
RespFnResponse function based on the exponential I-V curve model.
This model is from Rashid et al. (2016). Through this model you can set the sharpness of the non-linearity and the subgap resistance.
See
qmix.mathfn.ivcurve_models.exponentialfor the model.- Parameters:
vgap (float) – Gap voltage (un-normalized)
rn (float) – Normal resistance (un-normalized)
rsg (float) – Sub-gap resistance (un-normalized)
agap (float) – Gap smearing parameter (4e4 is typical)
- Keyword Arguments:
verbose (bool, default is True) – print info to terminal?
max_npts_dc (int, default is 101) – maximum number of points in DC I-V curve
max_npts_kk (int, default is 151) – maximum number of points in KK transform
max_interp_error (float, default is 0.001) – maximum interpolation error (in units of normalized current)
check_error (bool, default is False) – check interpolation error?
v_smear (float, default is None) – smear DC I-V curve by convolving with a Gaussian dist. with this std. dev.
kk_n (int, default is 50) – padding for Hilbert transform (see
qmix.mathfn.kktrans.kk_trans)spline_order (int, default is 3) – spline order for interpolations
- class qmix.respfn.RespFnFromIVData(voltage, current, **kwargs)
Bases:
RespFnGenerate the response function from I-V data.
Unlike
RespFn, this class will resample the I-V data to optimize the interpolation.Note
This class expects normalized I-V data that extends from at least
vb=0tovb=vlimit, wherevbis the bias voltage andvlimitis one of the keyword arguments.- Parameters:
voltage (ndarray) – normalized DC bias voltage
current (ndarray) – normalized DC tunneling current
- Keyword Arguments:
verbose (bool, default is True) – print info to terminal?
max_npts_dc (int, default is 101) – maximum number of points in DC I-V curve
max_npts_kk (int, default is 151) – maximum number of points in KK transform
max_interp_error (float, default is 0.001) – maximum interpolation error (in units of normalized current)
check_error (bool, default is False) – check interpolation error?
v_smear (float, default is None) – smear DC I-V curve by convolving with a Gaussian dist. with this std. dev.
kk_n (int, default is 50) – padding for Hilbert transform (see
qmix.mathfn.kktrans.kk_trans)spline_order (int, default is 3) – spline order for interpolations
vlimit (float, default is 1.8) – import all DC I-V data from
vb=0tovb=vlimit, wherevbis the bias voltage normalized to the gap voltage.
- class qmix.respfn.RespFnPerfect(**params)
Bases:
RespFnResponse function based on the perfect I-V curve model.
The perfect I-V curve has zero subgap current below the transition, and a current exactly equal to
vb * Rn, wherevbis the bias voltage andRnis the normal resistance, above the transition.See
qmix.mathfn.ivcurve_models.perfectfor the model.- Keyword Arguments:
verbose (bool, default is True) – print info to terminal?
max_npts_dc (int, default is 101) – maximum number of points in DC I-V curve
max_npts_kk (int, default is 151) – maximum number of points in KK transform
max_interp_error (float, default is 0.001) – maximum interpolation error (in units of normalized current)
check_error (bool, default is False) – check interpolation error?
v_smear (float, default is None) – smear DC I-V curve by convolving with a Gaussian dist. with this std. dev.
kk_n (int, default is 50) – padding for Hilbert transform (see
qmix.mathfn.kktrans.kk_trans)spline_order (int, default is 3) – spline order for interpolations
- class qmix.respfn.RespFnPolynomial(p_order=50, **kwargs)
Bases:
RespFnResponse function based on the polynomial I-V curve model.
This model is from Kennedy (1999). The order of the polynomial (
p_order) controls the sharpness of the non-linearity.See
qmix.mathfn.ivcurve_models.polynomialfor the model.- Parameters:
p_order (int) – Order of the polynomial
- Keyword Arguments:
verbose (bool, default is True) – print info to terminal?
max_npts_dc (int, default is 101) – maximum number of points in DC I-V curve
max_npts_kk (int, default is 151) – maximum number of points in KK transform
max_interp_error (float, default is 0.001) – maximum interpolation error (in units of normalized current)
check_error (bool, default is False) – check interpolation error?
v_smear (float, default is None) – smear DC I-V curve by convolving with a Gaussian dist. with this std. dev.
kk_n (int, default is 50) – padding for Hilbert transform (see
qmix.mathfn.kktrans.kk_trans)spline_order (int, default is 3) – spline order for interpolations
3.8. qmix.small_signal module
This module contains functions for the small-signal analysis of SIS mixers (Tucker theory).
Description:
In a heterodyne mixer, a strong local-oscillator (LO) signal pumps the junction, and weak signals at the sidebands of the LO harmonics are converted to the intermediate frequency (IF) and vice versa. If the weak signals are small enough, they are linearly related by the small-signal (conversion) admittance matrix
Y(Tucker, 1979; Tucker and Feldman, 1985; see references in online docs):I_m = sum_n Y[m, n] V_n
where V_m and I_m are the junction voltage and current phasors at sideband m, which has the frequency
m * f_lo + f_if(m = -num_sb … num_sb). Sideband 0 is the IF; sideband p > 0 is the upper sideband (USB) of LO harmonic p; sideband -p < 0 is the lower sideband (LSB) of LO harmonic p.The LO state comes from a single-tone harmonic balance (or any junction voltage at the LO and its harmonics). The admittance matrix then gives the response to weak signals at any IF frequency, without a multi-tone simulation. The results agree with multi-tone simulations in the limit of weak signals.
Typical workflow:
vj = harmonic_balance(cct, resp) # LO only y = admittance_matrix(vj, cct, resp, f_if) zt = sideband_impedances(z_if, z_usb, z_lsb) gain = conversion_gain(y, zt, 1) # USB -> IFThe shot noise of the junction (including its thermal and quantum limits) is described by the current noise correlation matrix
H(Tucker and Feldman, 1985), from which the noise temperature of the mixer follows:h = noise_matrix(vj, cct, resp, f_if, temp, vgap) tn = noise_temperature(y, h, zt, vgap, 1) # SSB, USB inputSeveral junctions (
qmix.circuit.MultiJunctionCircuit):admittance_matrixandnoise_matrixreturn one matrix per junction (junction axis first). The junctions are coupled by the embedding network, which is described at each sideband by its impedance matrix over the junction ports and one external port (sideband_networks): the port of the RF source (or image termination) at the RF sidebands, and of the IF load at the IF. The external port is terminated byz_ext(the source or load impedance).network_gain,network_output_noiseandnetwork_noise_temperaturethen give the gain and noise between external ports, including the thermal noise of a lossy network. This also works for one junction (e.g., to include the loss of its tuning circuit):vj = harmonic_balance(cct, resp) # several junctions y = admittance_matrix(vj, cct, resp, f_if) # y[j, m, n, i] h = noise_matrix(vj, cct, resp, f_if, temp) z_net = sideband_networks(z_if, z_usb, z_lsb) # (J+1)-port matrices z_ext = sideband_impedances(r_if, r_rf, r_rf) # terminations gain = network_gain(y, z_net, z_ext, 1) tn = network_noise_temperature(y, h, z_net, z_ext, vgap, f_lo, f_if, 1, temp=temp, temp_ext=temp)
Note
Phasors at negative frequencies. For m < 0, the frequency
m * f_lo + f_if is negative. The phasors V_m, I_m, the source
voltages and the impedances at these sidebands are the complex conjugates
of the values at the positive (physical) LSB frequency
|m| * f_lo - f_if. sideband_impedances and sideband_voltages
take the physical values and do this conversion; lsb converts the
results back.
Indexing. Arrays over sidebands are stored in natural order: sideband
m is at index m + num_sb.
All values are normalized, as in the rest of QMix: voltages to the gap voltage, currents to the gap current, admittances to 1 / Rn, impedances to Rn and frequencies to the gap frequency. Phasors are peak amplitudes.
- qmix.small_signal.admittance_matrix(vj, cct, resp, f_if, num_sb=None, num_b=15)
Calculate the small-signal admittance matrix (Tucker theory).
Equivalent to the formulation in Rice et al. (1999), Eqn. 29, and to SuperMix’s
sis_basic_device::small_signal.- Parameters:
vj (ndarray) – Junction voltage of the LO state,
vj[1, p, i]for LO harmonic p and bias voltagecct.vb[i](e.g., the output ofqmix.harmonic_balance.harmonic_balance)cct (qmix.circuit.EmbeddingCircuit) – Embedding circuit with one tone (the LO); its harmonics are included in the LO state
resp (qmix.respfn.RespFn) – Response function
f_if (float) – IF frequency (normalized), with
0 <= f_if < f_lo;f_if = 0gives the limit of a low IF (sidebands m and -m are then still treated as separate signals) and needs the derivatives of the response functionnum_sb (int, optional) – Number of sidebands on each side of the IF, default is
cct.num_pnum_b (int, optional) – Summation limit for the phase factor coefficients of the LO, default is 15
- Returns:
Admittance matrix
y[m + num_sb, n + num_sb, i]for sidebands m, n = -num_sb … num_sb (complex, normalized to 1 / Rn); for aqmix.circuit.MultiJunctionCircuit(vj[j, 1, p, i],respone or a list), one per junction,y[j, m, n, i], scaled by the relative area of each junction- Return type:
ndarray
- qmix.small_signal.conversion_gain(y, zt, m_in, m_out=0)
Transducer gain from sideband m_in to sideband m_out (default: the IF).
The ratio of the power delivered to the embedding impedance at m_out to the power available from a source at m_in (with the embedding impedance at m_in as its source impedance):
4 Re(zt_in) Re(zt_out) |I_out|^2 / |vt_in|^2.- Parameters:
y (ndarray) – Admittance matrix, from
admittance_matrixzt (ndarray) – Embedding impedances, from
sideband_impedancesm_in (int) – Input sideband (e.g., 1 for the USB, -1 for the LSB of the LO fundamental)
m_out (int, optional) – Output sideband, default is 0 (the IF)
- Returns:
Gain at each bias voltage
- Return type:
ndarray
- qmix.small_signal.embedding_noise(zt, temp, f_lo, f_if, vgap)
Thermal noise of the embedding impedances at all sidebands.
Each embedding impedance is a Thevenin source with a noise voltage of one-sided spectral density
4 k T_cw Re(Z), whereT_cw = (h f / 2 k) coth(h f / 2 k T)(Callen-Welton) includes the zero-point fluctuations, at the physical frequency of the sideband,f = |m * f_lo + f_if|. The noise at different sidebands is uncorrelated.- Parameters:
zt (ndarray) – Embedding impedances, from
sideband_impedancestemp (float or ndarray) – Physical temperature of the embedding circuit, in [K]; a scalar or one value per sideband (natural order)
f_lo (float) – LO frequency (normalized)
f_if (float) – IF frequency (normalized)
vgap (float) – Gap voltage, in [V] (sets the gap frequency)
- Returns:
Noise voltage spectral densities at sidebands m = -num_sb … num_sb, normalized to
e * Vgap * Rn- Return type:
ndarray
- qmix.small_signal.lsb(values, p)
Physical (positive-frequency) phasor at the LSB of LO harmonic p from an array over sidebands (e.g., from
solve_sidebands).
- qmix.small_signal.network_gain(y, z_net, z_ext, m_in, m_out=0)
Transducer gain from the external port at sideband m_in to the external port at sideband m_out (default: the IF), with several junctions.
The ratio of the power delivered to the load
z_extat m_out to the power available from a source with impedancez_extat m_in.- Parameters:
y (ndarray) – Admittance matrices,
y[j, m, n, i], fromadmittance_matrix(ory[m, n, i]for one junction)z_net (ndarray) – Embedding networks, from
sideband_networksz_ext (ndarray) – Impedances terminating the external port at all sidebands (source / load impedances), from
sideband_impedances(normalized to Rn, with positive real parts)m_in (int) – Input sideband (e.g., 1 for the USB)
m_out (int, optional) – Output sideband, default is 0 (the IF)
- Returns:
Gain at each bias voltage
- Return type:
ndarray
- qmix.small_signal.network_noise_temperature(y, h, z_net, z_ext, vgap, f_lo, f_if, m_in, m_out=0, temp=None, temp_ext=None)
Input noise temperature (SSB) referred to the external port at sideband m_in, with several junctions:
network_output_noise(without the termination noise at m_in and m_out) divided bynetwork_gain. Seenoise_temperaturefor the DSB noise temperature.- Parameters:
y – see
network_output_noiseh – see
network_output_noisez_net – see
network_output_noisez_ext – see
network_output_noisevgap – see
network_output_noisef_lo – see
network_output_noisef_if – see
network_output_noisem_in (int) – Input sideband (e.g., 1 for the USB)
m_out (int, optional) – Output sideband, default is 0 (the IF)
temp – see
network_output_noisetemp_ext – see
network_output_noise
- Returns:
Noise temperature at each bias voltage, in [K]
- Return type:
ndarray
- qmix.small_signal.network_output_noise(y, h, z_net, z_ext, vgap, f_lo, f_if, m_out=0, temp=None, temp_ext=None, exclude=None)
Noise power delivered to the load at the external port at sideband m_out (default: the IF), per unit bandwidth and in units of the Boltzmann constant (a noise temperature, in [K]), with several junctions.
The noise sources are the junctions (
h; uncorrelated between junctions), the embedding network (iftempis given) and the terminations of the external port (iftemp_extis given). A passive network at temperature T has open-circuit noise voltages with the correlation matrix2 k T_cw (Z + Z^dagger)(Twiss), and a termination4 k T_cw Re(z_ext), with the Callen-Welton temperatureT_cwat the physical frequency of each sideband (seeembedding_noise). A lossless network has no noise of its own.- Parameters:
y (ndarray) – Admittance matrices, from
admittance_matrixh (ndarray) – Noise correlation matrices, from
noise_matrixz_net (ndarray) – Embedding networks, from
sideband_networksz_ext (ndarray) – Terminations of the external port, see
network_gainvgap (float) – Gap voltage, in [V]
f_lo (float) – LO frequency (normalized)
f_if (float) – IF frequency (normalized)
m_out (int, optional) – Output sideband, default is 0 (the IF)
temp (float or ndarray, optional) – Physical temperature of the embedding network, in [K] (scalar or one per sideband), default is None (no network noise)
temp_ext (float or ndarray, optional) – Temperature of the terminations of the external port, in [K] (scalar or one per sideband), default is None (no termination noise)
exclude (list, optional) – Sidebands whose termination noise is not included, default is
[m_out](the load itself)
- Returns:
Output noise temperature at each bias voltage, in [K]
- Return type:
ndarray
- qmix.small_signal.noise_matrix(vj, cct, resp, f_if, temp, vgap=None, num_sb=None, num_b=15)
Calculate the current noise correlation matrix of the junction (Tucker theory).
The noise currents at the sidebands, delta I_m, are correlated:
<delta I_m delta I_n*> = H[m, n] * e * Igap * df, where df is the bandwidth,Igap = Vgap / Rn, and the currents are RMS values (H is the one-sided spectral density). This includes shot noise and its thermal (coth) and quantum limits, but not the noise of the embedding circuit. Equivalent to SuperMix’ssis_basic_device::noise.- Parameters:
vj (ndarray) – Junction voltage of the LO state, see
admittance_matrixcct (qmix.circuit.EmbeddingCircuit) – Embedding circuit with one tone
resp (qmix.respfn.RespFn) – Response function
f_if (float) – IF frequency (normalized), with
0 <= f_if < f_lotemp (float) – Physical temperature of the junction, in [K]
vgap (float, optional) – Gap voltage, in [V], default is
cct.vgapnum_sb (int, optional) – Number of sidebands on each side of the IF, default is
cct.num_pnum_b (int, optional) – Summation limit for the phase factor coefficients of the LO, default is 15
- Returns:
Noise correlation matrix
h[m + num_sb, n + num_sb, i](Hermitian, normalized toe * Igap); for aqmix.circuit.MultiJunctionCircuit, one per junction,h[j, m, n, i], scaled by the relative area of each junction (the noise of different junctions is uncorrelated)- Return type:
ndarray
- qmix.small_signal.noise_temperature(y, h, zt, vgap, m_in, m_out=0, v_noise=None)
Input noise temperature of the mixer, referred to sideband m_in: the output noise (
output_noise) divided by the conversion gain from m_in (conversion_gain).This is the single-sideband (SSB) noise temperature. The noise of the source at m_in and of the load at m_out are not included (if
v_noiseis given, the embedding noise at all other sidebands, e.g., the image, is). For the double-sideband (DSB) noise temperature, divide the output noise (excluding the noise at both sidebands) by the sum of the gains from the USB and the LSB.Note
With
v_noise=None, only the junction’s noise is included. Since the zero-point fluctuations of the embedding are then missing, the result can be below the quantum limit.- Parameters:
y (ndarray) – Admittance matrix, from
admittance_matrixh (ndarray) – Noise correlation matrix, from
noise_matrixzt (ndarray) – Embedding impedances, from
sideband_impedancesvgap (float) – Gap voltage, in [V]
m_in (int) – Input sideband (e.g., 1 for the USB)
m_out (int, optional) – Output sideband, default is 0 (the IF)
v_noise (ndarray, optional) – Noise of the embedding impedances, from
embedding_noise; default is None (junction noise only)
- Returns:
Noise temperature at each bias voltage, in [K]
- Return type:
ndarray
- qmix.small_signal.output_noise(y, h, zt, vgap, m_out=0, v_noise=None, exclude=None)
Noise power delivered to the embedding impedance at sideband m_out (default: the IF), per unit bandwidth and in units of the Boltzmann constant (i.e., a noise temperature, in [K]).
The noise sources are the junction (
h) and, optionally, the embedding impedances (v_noise, Thevenin noise voltages). They drive the sideband network:(1 + Y Z) I = delta I + Y E, so the current correlation matrix isA (H + Y S Y^dagger) A^dagger, withA = (1 + Y Z)^-1and S the (diagonal) spectral densities of E. The noise of the load at m_out itself is not included.- Parameters:
y (ndarray) – Admittance matrix, from
admittance_matrixh (ndarray) – Noise correlation matrix, from
noise_matrixzt (ndarray) – Embedding impedances, from
sideband_impedancesvgap (float) – Gap voltage, in [V]
m_out (int, optional) – Output sideband, default is 0 (the IF)
v_noise (ndarray, optional) – Noise of the embedding impedances, from
embedding_noise; default is None (junction noise only)exclude (list, optional) – Sidebands whose embedding noise is not included, default is
[m_out]
- Returns:
Output noise temperature at each bias voltage, in [K]
- Return type:
ndarray
- qmix.small_signal.sideband_impedances(z_if, z_usb, z_lsb)
Embedding impedances at all sidebands (for the small-signal analysis).
- Parameters:
z_if (complex) – Embedding impedance at the IF
z_usb (complex or array) – Embedding impedance at the USB of each LO harmonic p = 1 … num_sb (at frequency
p * f_lo + f_if)z_lsb (complex or array) – Embedding impedance at the LSB of each LO harmonic p = 1 … num_sb (at the physical frequency
p * f_lo - f_if);0for a short circuit
- Returns:
Impedances at sidebands m = -num_sb … num_sb (natural order, with the complex conjugate for m < 0, see module docstring)
- Return type:
ndarray
- qmix.small_signal.sideband_networks(z_if, z_usb, z_lsb)
Embedding networks at all sidebands, for several junctions.
At each sideband, the embedding network is described by its impedance matrix over the
num_jjunction ports and one external port (the last port; e.g., the RF input at the RF sidebands and the IF output at the IF), withV = Z I(Iinto the network). The junction capacitances should be included (in parallel with the junction ports; seeqmix.network.impedance_matrix). The external port is terminated byz_ext(seenetwork_gain).- Parameters:
z_if (ndarray) – Impedance matrix at the IF, shape (J+1, J+1)
z_usb (ndarray) – Impedance matrices at the USB of each LO harmonic p = 1 … num_sb, shape (num_sb, J+1, J+1) (or (J+1, J+1) for one)
z_lsb (ndarray) – The same at the LSB of each LO harmonic (at the physical frequency
p * f_lo - f_if)
- Returns:
Impedance matrices at sidebands m = -num_sb … num_sb,
z_net[m + num_sb](with the complex conjugate for m < 0, see module docstring), normalized to Rn- Return type:
ndarray
- qmix.small_signal.sideband_voltages(v_if=0, v_usb=0, v_lsb=0, num_sb=None)
Thevenin (source) voltages at all sidebands.
- Parameters:
v_if (complex, optional) – Source voltage at the IF, default is 0
v_usb (complex or array, optional) – Source voltage at the USB of each LO harmonic p = 1 … num_sb, default is 0
v_lsb (complex or array, optional) – Source voltage at the LSB of each LO harmonic p = 1 … num_sb (phasor at the physical frequency), default is 0
num_sb (int, optional) – Number of sidebands, needed if both v_usb and v_lsb are scalars
- Returns:
Source voltages at sidebands m = -num_sb … num_sb (natural order, with the complex conjugate for m < 0)
- Return type:
ndarray
- qmix.small_signal.solve_sidebands(y, zt, vt)
Junction voltages and currents at all sidebands.
Solves I = Y V together with V_m = vt_m - zt_m I_m, i.e.,
(1 + Z Y) V = vt, at each bias voltage.- Parameters:
y (ndarray) – Admittance matrix, from
admittance_matrixzt (ndarray) – Embedding impedances, from
sideband_impedancesvt (ndarray) – Source voltages, from
sideband_voltages
- Returns:
Junction voltages
v[m + num_sb, i]and currentsi[m + num_sb, i](negative-frequency convention for m < 0; uselsbto get the physical LSB phasors)- Return type:
tuple
3.9. qmix.superconductor module
This module contains functions and classes for the surface impedance of
superconducting and normal metal films, for use in transmission lines (e.g.,
qmix.network.microstrip).
Description:
The tuning circuits of SIS mixers are usually made from superconducting films (e.g., Nb or NbTiN). Below the gap frequency, these films have a small surface resistance but a large kinetic inductance, which slows the waves on the lines by ~10-20% and therefore shifts the frequencies at which the tuning circuit resonates. Above the gap frequency (~700 GHz for Nb), photons break Cooper pairs and the films become lossy.
The complex conductivity of a superconductor is calculated with the Mattis-Bardeen theory in the local (dirty) limit (
mattis_bardeen), using the BCS temperature dependence of the energy gap (energy_gap). The surface impedance of a film of finite thickness (or of a stack of films) follows from the conductivity by treating the film as a section of transmission line (film_impedance).The calculations are done by the
mattisbardeenpackage (https://github.com/garrettj403/Mattis-Bardeen); this module adapts it to QMix (film objects forqmix.network.microstrip, and the gap voltage at T = 0 as the material parameter). Its physical constants come frommattisbardeen.sc(scipy.constants), read when the functions are called.The film classes (
NormalFilm,SuperconductingFilmandMultilayer) bundle the material parameters, so that they can be passed to the transmission line functions inqmix.network:nb = SuperconductingFilm(vgap=2.8e-3, tc=9.2, rho_n=5e-8, thickness=300e-9) nb.zs(500e9, 4.2) # surface impedance, in [ohms]
Note
Unlike the rest of QMix, the values here are not normalized: frequencies are in [Hz], temperatures in [K], voltages in [V], lengths in [m], resistivities in [ohm m] and conductivities in [S/m].
Complex values use the engineering convention exp(+j w t), as for
the impedances in the rest of QMix: an inductive reactance is positive,
and the conductivity of a superconductor is sigma1 - j sigma2.
- class qmix.superconductor.Multilayer(films, z_back=None)
Bases:
objectStack of films, e.g., a thin Nb film on top of a NbTiN film.
- Parameters:
films (list) – Films (
NormalFilmorSuperconductingFilm), starting from the one that carries the current (the surface facing the dielectric)z_back (complex, optional) – Impedance behind the last film, in [ohms]; default is the impedance of free space (the
z_backvalues of the individual films are not used)
- property thickness
Total thickness, in [m].
- zs(freq, temp)
Surface impedance.
- Parameters:
freq (float or ndarray) – Frequency, in [Hz]
temp (float) – Temperature, in [K]
- Returns:
Surface impedance, in [ohms]
- Return type:
complex or ndarray
- class qmix.superconductor.NormalFilm(rho, thickness, z_back=None)
Bases:
_FilmNormal metal film (local conductivity, no anomalous skin effect).
- Parameters:
rho (float) – Resistivity, in [ohm m]
thickness (float) – Film thickness, in [m]
z_back (complex, optional) – Impedance behind the film, in [ohms]; default is the impedance of free space
- sigma(freq, temp=None)
Conductivity, in [S/m] (independent of frequency and temperature).
- Parameters:
freq (float or ndarray) – Frequency, in [Hz]
temp (float, optional) – Temperature, in [K] (not used)
- Returns:
Conductivity, in [S/m]
- Return type:
complex or ndarray
- class qmix.superconductor.SuperconductingFilm(vgap, tc, rho_n, thickness, z_back=None)
Bases:
_FilmSuperconducting film (Mattis-Bardeen theory in the local limit).
- Parameters:
vgap (float) – Gap voltage of the superconductor (2 Delta(0) / e), in [V], e.g., ~2.8e-3 for Nb (1.4 meV per electron for the energy gap Delta)
tc (float) – Critical temperature, in [K]
rho_n (float) – Normal-state resistivity (just above Tc), in [ohm m]
thickness (float) – Film thickness, in [m]
z_back (complex, optional) – Impedance behind the film, in [ohms]; default is the impedance of free space
- property fgap
Gap frequency (2 Delta(0) / h), in [Hz].
- penetration_depth(temp=0.0)
London penetration depth in the local (dirty) limit.
lambda = sqrt(hbar rho_n / (pi mu0 Delta(T) tanh(Delta(T) / 2 k T))), the low-frequency limit of the Mattis-Bardeen conductivity (mattisbardeen.penetration_depth; inf above Tc).- Parameters:
temp (float, optional) – Temperature, in [K]; default is 0
- Returns:
Penetration depth, in [m]
- Return type:
float
- sigma(freq, temp)
Complex conductivity, from the Mattis-Bardeen theory.
The values are cached (the integrals take ~30 us per point). Changing
vgaportcclears the cache.- Parameters:
freq (float or ndarray) – Frequency, in [Hz]
temp (float) – Temperature, in [K]
- Returns:
Conductivity,
sigma1 - j sigma2, in [S/m]- Return type:
complex or ndarray
- qmix.superconductor.energy_gap(temp, tc)
Temperature dependence of the energy gap, from BCS theory.
Solves the weak-coupling BCS gap equation (
mattisbardeen.gap_voltage),ln(Delta(0) / Delta) = 2 int_0^inf f(E) / E d(xi)withE = sqrt(xi^2 + Delta^2)andDelta(0) = 1.764 k Tc.- Parameters:
temp (float or ndarray) – Temperature, in [K]
tc (float) – Critical temperature, in [K]
- Returns:
Delta(T) / Delta(0), zero for T >= Tc
- Return type:
float or ndarray
- qmix.superconductor.film_impedance(freq, layers, z_back=None)
Surface impedance of a film (or a stack of films) of finite thickness.
Each layer is treated as a section of transmission line, with the wave impedance and wavenumber of a plane wave in the metal (local conductivity, including the displacement current). The back of the stack is terminated by
z_back; this models radiation from the back side, and only matters for films thinner than a few penetration depths. (mattisbardeen.film_impedance.)- Parameters:
freq (float or ndarray) – Frequency, in [Hz]
layers (list) – List of
(sigma, thickness)pairs, starting from the layer that carries the current (the surface facing the dielectric) and moving away from it.sigmais the complex conductivity in [S/m] (scalar or one value per frequency) andthicknessis in [m].z_back (complex, optional) – Impedance behind the last layer, in [ohms]; default is the impedance of free space
- Returns:
Surface impedance, in [ohms]
- Return type:
complex or ndarray
- qmix.superconductor.mattis_bardeen(freq, temp, vgap, tc)
Complex conductivity of a superconductor from the Mattis-Bardeen theory.
The conductivity is normalized to the normal-state conductivity, and it is calculated in the local (dirty) limit (
mattisbardeen.conductance). The energy gap at T = 0 is given by the gap voltage (vgap = 2 Delta(0) / e), and its temperature dependence by BCS theory (energy_gap), sovgapandtcdon’t need to be consistent with the BCS ratio.- Parameters:
freq (float or ndarray) – Frequency, in [Hz]
temp (float) – Temperature, in [K]
vgap (float) – Gap voltage (2 Delta(0) / e), in [V]
tc (float) – Critical temperature, in [K]
- Returns:
- Normalized conductivity,
sigma1 - j sigma2; 1 above the critical temperature
- Normalized conductivity,
- Return type:
complex or ndarray
3.10. Module contents
Quantum Mixing Software
QMix is used to simulate Superconductor/Insulator/Superconductor (SIS) mixers. It uses multi-tone spectral domain analysis, which makes QMix ideal for simulating higher-order harmonics, power saturation and wide IF bandwidth devices.