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, and
(where the inversion is well-defined) back again. Import reads the source
object’s native parameters and hands them to the matching quchip constructor,
which 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.
Every mapping’s docstring states its parameter translation; these are the reference examples for authoring further mappings.
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.- Parameters:
- Return type:
- export_model(device, **opts)[source]¶
Convert quchip device into a third-party object.
Override to support export; overriding requires setting
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 hands the resulting fixed-frequency transmon toChargeBasisTransmon; the remaining parameters copy across exactly as inTransmonMapping. There is no export: a single frequency does not determine(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.- Parameters:
- Return type:
- class quchip.interop.scqubits.devices.FluxoniumMapping[source]¶
Bases:
ModelMappingMap
scqubits.Fluxoniumto and fromFluxonium.Parameter copy across the three circuit energies plus the external flux:
scqubits
quchip
ECE_CEJE_JELE_Lfluxphi_exttruncated_dimlevelsThe native discretizations differ — scqubits uses a harmonic-oscillator basis of size
cutoff, quchip a plane-wave phase grid ofnum_basispoints — so quchip keeps its own default grid rather than mirroringcutoff. The physics is identical; only the basis is not, which is why the spectrum agreement is atatol=1e-6rather than machine precision. Export uses scqubits’cutoff=110default.- 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; overriding requires setting
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; overriding requires setting
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\), whose eigenvalues are \(E_n = (E_{\rm osc} + K)\, n - K\, n^2\). quchip’s
KerrCavitywrites \(H = \omega\, \hat n - K'\, \hat n(\hat n - 1)\), with eigenvalues \(E_n = \omega\, n - K'\, n(n-1) = (\omega + K')\, n - K'\, n^2\).Matching term by term: the \(n^2\) coefficient gives
kerr = K, and the \(n\) coefficient (withkerr = Kalready fixed) givesfreq = E_osc. Both spectra sit at \(E_0 = 0\), so the translation is the direct copyfreq = E_osc,kerr = K— no sign flip. Import only:KerrCavityrequireskerr >= 0and models theK > 0(self-focusing) branch 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.- Parameters:
- Return type:
- class quchip.interop.scqubits.devices.GenericQubitMapping[source]¶
Bases:
ModelMappingMap
scqubits.GenericQubittoDuffingTransmon(import-only).The generic two-level system \(H = \tfrac12 E\, \sigma_z\) has 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.- Parameters:
- Return type:
- class quchip.interop.scqubits.devices.DuffingTransmonMapping[source]¶
Bases:
ModelMappingMap
DuffingTransmontoscqubits.Transmon(export-only).A Duffing transmon is specified by
(freq, anharmonicity); scqubits’Transmon.find_EJ_ECinverts that pair to the(EJ, EC)that best reproduce the same 0->1 splitting and anharmonicity, from which the charge-basis transmon is built (truncated_dim = device.levels).ncut(default 30, scqubits’ own inversion default) is an export option, passed identically to bothfind_EJ_ECand the reconstructedTransmonso the two never disagree.DuffingTransmonhas no offset-charge concept of its own to translate, so the reconstructed transmon is built at the charge sweet spotng=0. Import-only in the other direction is already covered byTransmonMapping.- target¶
alias of
DuffingTransmon
- class quchip.interop.scqubits.devices.ZeroPiMapping[source]¶
Bases:
ModelMappingMap
scqubits.ZeroPitoEigenbasisDevice(import-only).ZeroPi is a two-mode circuit (\(\phi\), \(\theta\)) diagonalized on a joint phi-grid / charge-basis product space; quchip has no native model for it, since none of its circuit devices carry a second coordinate. Rather than reimplementing that two-mode Hamiltonian, this mapping takes the exact-lane recipe: diagonalize with scqubits once, then hand the resulting energies and eigenbasis-projected operators to
EigenbasisDevice, which treats an already-diagonal spectrum as its native basis (see that class’s docstring). The oneobj.eigensys(...)call is reused for both operators via scqubits’energy_esys=argument (process_op()), so the (comparatively expensive) sparse diagonalization runs exactly once.The snapshot reproduces
obj’s spectrum and charge/phase matrix elements exactly, at the parameter point it was taken at, but it is a frozen numeric table, not a Hamiltonian recipe: unlike the parametric mappings above, the imported device is not differentiable with respect to ZeroPi’s circuit parameters (EJ,EL,ECJ,EC,ng,flux). This is the reference recipe for wrapping any other scqubits (or third-party) type quchip has no native model for.- 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.- Parameters:
- Return type: