quchip.interop.scqubits.devices¶
Shipped scqubits <-> quchip device mappings.
Each ModelMapping here transcribes one scqubits
circuit-QED object into the quchip device that carries the same spectrum. Where
the inversion is well-defined, the mapping also goes back. Import reads the
source object’s native parameters and passes them to the matching quchip
constructor. The constructor rebuilds the Hamiltonian from those parameters, so
the imported device stays differentiable in them. Export reads the concrete
device parameters, guards each against JAX tracers via
maybe_concrete_scalar(), and reconstructs the scqubits object.
Each mapping’s docstring states its parameter translation and serves as a
reference example for new mappings. scqubits stores energies in its global
unit, scqubits.get_units() (GHz by default). Every energy is converted
between that unit and quchip’s GHz at this boundary.
Classes
Map |
|
Map |
|
Map |
|
Map |
|
Map |
|
Map |
|
Map |
|
Map |
- class quchip.interop.scqubits.devices.TransmonMapping[source]¶
Bases:
ModelMappingMap
scqubits.Transmonto and fromChargeBasisTransmon.Both sides diagonalize the Cooper-pair-box Hamiltonian \(H = 4 E_C (\hat n - n_g)^2 - E_J \cos\hat\varphi\) in the integer charge basis, so the translation is a direct parameter copy:
scqubits
quchip
ECE_CEJE_Jngn_gncutnum_basis = 2*ncut + 1truncated_dimlevels- target¶
alias of
ChargeBasisTransmon
- import_model(obj, *, levels=None, label=None, **noise_kwargs)[source]¶
Convert third-party object obj into a quchip device.
Override to support import. The base implementation raises
NotImplementedError.
- export_model(device, **opts)[source]¶
Convert quchip device into a third-party object.
Override to support export, and also set
target. The base implementation raisesNotImplementedError.
- class quchip.interop.scqubits.devices.TunableTransmonMapping[source]¶
Bases:
ModelMappingMap
scqubits.TunableTransmontoChargeBasisTransmon(import-only).The flux-tunable SQUID transmon has a flux-dependent effective Josephson energy
\[E_J(\Phi) = E_J^{\max} \sqrt{\cos^2(\pi\Phi) + d^2 \sin^2(\pi\Phi)},\]with
dthe junction asymmetry. Import evaluates \(E_J(\Phi)\) at the object’sfluxand passes the resulting fixed-frequency transmon toChargeBasisTransmon. The other parameters copy across exactly as inTransmonMapping. There is no export, because a single frequency does not set(EJmax, d, flux).- import_model(obj, *, levels=None, label=None, **noise_kwargs)[source]¶
Convert third-party object obj into a quchip device.
Override to support import. The base implementation raises
NotImplementedError.
- class quchip.interop.scqubits.devices.FluxoniumMapping[source]¶
Bases:
ModelMappingMap
scqubits.Fluxoniumto and fromFluxonium.Parameter copy across the three circuit energies and the external flux:
scqubits
quchip
ECE_CEJE_JELE_Lfluxphi_exttruncated_dimlevelsThe native discretizations differ: scqubits uses a harmonic-oscillator basis of size
cutoff, whereas quchip uses a finite-difference phase grid ofnum_basispoints. Therefore quchip keeps its own default grid and does not mirrorcutoff. Both represent the fluxonium Hamiltonian, but check each discretization’s convergence for the selected parameters. Export uses the scqubits defaultcutoff=110.- import_model(obj, *, levels=None, label=None, **noise_kwargs)[source]¶
Convert third-party object obj into a quchip device.
Override to support import. The base implementation raises
NotImplementedError.
- export_model(device, **opts)[source]¶
Convert quchip device into a third-party object.
Override to support export, and also set
target. The base implementation raisesNotImplementedError.
- class quchip.interop.scqubits.devices.OscillatorMapping[source]¶
Bases:
ModelMappingMap
scqubits.Oscillatorto and fromResonator.A harmonic oscillator \(H = E_{\rm osc}\, a^\dagger a\) maps to the resonator \(H = \omega\, \hat n\) with
freq = E_oscandlevels = truncated_dim. The scqubitsl_osc(an operator-definition convention) has no spectral effect and is dropped.- import_model(obj, *, levels=None, label=None, **noise_kwargs)[source]¶
Convert third-party object obj into a quchip device.
Override to support import. The base implementation raises
NotImplementedError.
- export_model(device, **opts)[source]¶
Convert quchip device into a third-party object.
Override to support export, and also set
target. The base implementation raisesNotImplementedError.
- class quchip.interop.scqubits.devices.KerrOscillatorMapping[source]¶
Bases:
ModelMappingMap
scqubits.KerrOscillatortoKerrCavity(import-only).scqubits writes the Kerr oscillator as \(H = E_{\rm osc}\, a^\dagger a - K\, a^\dagger a^\dagger a a\), with the eigenvalues \(E_n = (E_{\rm osc} + K)\, n - K\, n^2\). The quchip
KerrCavitywrites \(H = \omega\, \hat n - K'\, \hat n(\hat n - 1)\), with the eigenvalues \(E_n = \omega\, n - K'\, n(n-1) = (\omega + K')\, n - K'\, n^2\).Match the terms one by one. The \(n^2\) coefficient gives
kerr = K. Withkerr = Kfixed, the \(n\) coefficient givesfreq = E_osc. Both spectra start at \(E_0 = 0\), so the translation is the direct copyfreq = E_osc,kerr = K, with no sign flip. Import only:KerrCavityrequireskerr >= 0, and it models theK > 0(self-focusing) branch that scqubits uses.- target¶
alias of
KerrCavity
- import_model(obj, *, levels=None, label=None, **noise_kwargs)[source]¶
Convert third-party object obj into a quchip device.
Override to support import. The base implementation raises
NotImplementedError.
- class quchip.interop.scqubits.devices.GenericQubitMapping[source]¶
Bases:
ModelMappingMap
scqubits.GenericQubittoDuffingTransmon(import-only).The generic two-level system \(H = \tfrac12 E\, \sigma_z\) has the level splitting
E. It maps to a two-levelDuffingTransmonwithfreq = E,anharmonicity = 0(irrelevant at two levels), andlevels = 2.- import_model(obj, *, levels=None, label=None, **noise_kwargs)[source]¶
Convert third-party object obj into a quchip device.
Override to support import. The base implementation raises
NotImplementedError.
- class quchip.interop.scqubits.devices.DuffingTransmonMapping[source]¶
Bases:
ModelMappingMap
DuffingTransmontoscqubits.Transmon(export-only).A Duffing transmon is specified by
(freq, anharmonicity). The scqubitsTransmon.find_EJ_ECinverts that pair to the(EJ, EC)that best reproduce the same 0->1 splitting and anharmonicity. The export builds the charge-basis transmon from these values (truncated_dim = device.levels).ncut(default 30, the scqubits inversion default) is an export option. The samencutgoes tofind_EJ_ECand to the reconstructedTransmon, so the two always agree.DuffingTransmonhas no offset-charge concept of its own to translate, so the export builds the transmon at the charge sweet spotng=0. The other direction is import only and already covered byTransmonMapping.- target¶
alias of
DuffingTransmon
- export_model(device, *, ncut=30, **opts)[source]¶
Convert quchip device into a third-party object.
Override to support export, and also set
target. The base implementation raisesNotImplementedError.
- class quchip.interop.scqubits.devices.ZeroPiMapping[source]¶
Bases:
ModelMappingMap
scqubits.ZeroPitoEigenbasisDevice(import-only).ZeroPi is a two-mode circuit (\(\phi\), \(\theta\)), which scqubits diagonalizes on a joint phi-grid / charge-basis product space. There is no native quchip model for it, because none of its circuit devices carry a second coordinate. Instead of reimplementing that two-mode Hamiltonian, this mapping takes the frozen-snapshot path and diagonalizes with scqubits. It passes the resulting energies and eigenbasis-projected operators to
EigenbasisDevice. That class uses an already-diagonal spectrum as its native basis (see its docstring).The snapshot reproduces the spectrum and charge/phase matrix elements of
objexactly at its parameter point, but it is a frozen numeric table, not a parametric Hamiltonian model. Unlike the parametric mappings above, the imported device is not differentiable in the ZeroPi circuit parameters (EJ,EL,ECJ,EC,ng,flux). This path is the reference for wrapping any other scqubits (or third-party) type that has no native quchip model.- import_model(obj, *, levels=None, label=None, **noise_kwargs)[source]¶
Convert third-party object obj into a quchip device.
Override to support import. The base implementation raises
NotImplementedError.