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

DuffingTransmonMapping()

Map DuffingTransmon to scqubits.Transmon (export-only).

FluxoniumMapping()

Map scqubits.Fluxonium to and from Fluxonium.

GenericQubitMapping()

Map scqubits.GenericQubit to DuffingTransmon (import-only).

KerrOscillatorMapping()

Map scqubits.KerrOscillator to KerrCavity (import-only).

OscillatorMapping()

Map scqubits.Oscillator to and from Resonator.

TransmonMapping()

Map scqubits.Transmon to and from ChargeBasisTransmon.

TunableTransmonMapping()

Map scqubits.TunableTransmon to ChargeBasisTransmon (import-only).

ZeroPiMapping()

Map scqubits.ZeroPi to EigenbasisDevice (import-only).

class quchip.interop.scqubits.devices.TransmonMapping[source]

Bases: ModelMapping

Map scqubits.Transmon to and from ChargeBasisTransmon.

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

EC

E_C

EJ

E_J

ng

n_g

ncut

num_basis = 2*ncut + 1

truncated_dim

levels

source: ClassVar[str | None] = 'scqubits.Transmon'
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:
  • obj (Any)

  • levels (int | None)

  • label (str | None)

  • noise_kwargs (Any)

Return type:

ChargeBasisTransmon

export_model(device, **opts)[source]

Convert quchip device into a third-party object.

Override to support export; overriding requires setting target. The base implementation raises NotImplementedError.

Parameters:
Return type:

Any

library: ClassVar[str | None] = 'scqubits'
class quchip.interop.scqubits.devices.TunableTransmonMapping[source]

Bases: ModelMapping

Map scqubits.TunableTransmon to ChargeBasisTransmon (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 d the junction asymmetry. Import evaluates \(E_J(\Phi)\) at the object’s flux and hands the resulting fixed-frequency transmon to ChargeBasisTransmon; the remaining parameters copy across exactly as in TransmonMapping. There is no export: a single frequency does not determine (EJmax, d, flux).

source: ClassVar[str | None] = 'scqubits.TunableTransmon'
target: ClassVar[type | None] = None
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:
  • obj (Any)

  • levels (int | None)

  • label (str | None)

  • noise_kwargs (Any)

Return type:

ChargeBasisTransmon

library: ClassVar[str | None] = 'scqubits'
class quchip.interop.scqubits.devices.FluxoniumMapping[source]

Bases: ModelMapping

Map scqubits.Fluxonium to and from Fluxonium.

Parameter copy across the three circuit energies plus the external flux:

scqubits

quchip

EC

E_C

EJ

E_J

EL

E_L

flux

phi_ext

truncated_dim

levels

The native discretizations differ — scqubits uses a harmonic-oscillator basis of size cutoff, quchip a plane-wave phase grid of num_basis points — so quchip keeps its own default grid rather than mirroring cutoff. The physics is identical; only the basis is not, which is why the spectrum agreement is at atol=1e-6 rather than machine precision. Export uses scqubits’ cutoff=110 default.

source: ClassVar[str | None] = 'scqubits.Fluxonium'
target

alias of Fluxonium

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:
  • obj (Any)

  • levels (int | None)

  • label (str | None)

  • noise_kwargs (Any)

Return type:

Fluxonium

export_model(device, **opts)[source]

Convert quchip device into a third-party object.

Override to support export; overriding requires setting target. The base implementation raises NotImplementedError.

Parameters:
Return type:

Any

library: ClassVar[str | None] = 'scqubits'
class quchip.interop.scqubits.devices.OscillatorMapping[source]

Bases: ModelMapping

Map scqubits.Oscillator to and from Resonator.

A harmonic oscillator \(H = E_{\rm osc}\, a^\dagger a\) maps to the resonator \(H = \omega\, \hat n\) with freq = E_osc and levels = truncated_dim. The scqubits l_osc (an operator-definition convention) has no spectral effect and is dropped.

source: ClassVar[str | None] = 'scqubits.Oscillator'
target

alias of Resonator

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:
  • obj (Any)

  • levels (int | None)

  • label (str | None)

  • noise_kwargs (Any)

Return type:

Resonator

export_model(device, **opts)[source]

Convert quchip device into a third-party object.

Override to support export; overriding requires setting target. The base implementation raises NotImplementedError.

Parameters:
Return type:

Any

library: ClassVar[str | None] = 'scqubits'
class quchip.interop.scqubits.devices.KerrOscillatorMapping[source]

Bases: ModelMapping

Map scqubits.KerrOscillator to KerrCavity (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 KerrCavity writes \(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 (with kerr = K already fixed) gives freq = E_osc. Both spectra sit at \(E_0 = 0\), so the translation is the direct copy freq = E_osc, kerr = K — no sign flip. Import only: KerrCavity requires kerr >= 0 and models the K > 0 (self-focusing) branch scqubits uses.

source: ClassVar[str | None] = 'scqubits.KerrOscillator'
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:
  • obj (Any)

  • levels (int | None)

  • label (str | None)

  • noise_kwargs (Any)

Return type:

KerrCavity

library: ClassVar[str | None] = 'scqubits'
class quchip.interop.scqubits.devices.GenericQubitMapping[source]

Bases: ModelMapping

Map scqubits.GenericQubit to DuffingTransmon (import-only).

The generic two-level system \(H = \tfrac12 E\, \sigma_z\) has level splitting E. It maps to a two-level DuffingTransmon with freq = E, anharmonicity = 0 (irrelevant at two levels), and levels = 2.

source: ClassVar[str | None] = 'scqubits.GenericQubit'
target: ClassVar[type | None] = None
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:
  • obj (Any)

  • levels (int | None)

  • label (str | None)

  • noise_kwargs (Any)

Return type:

DuffingTransmon

library: ClassVar[str | None] = 'scqubits'
class quchip.interop.scqubits.devices.DuffingTransmonMapping[source]

Bases: ModelMapping

Map DuffingTransmon to scqubits.Transmon (export-only).

A Duffing transmon is specified by (freq, anharmonicity); scqubits’ Transmon.find_EJ_EC inverts 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 both find_EJ_EC and the reconstructed Transmon so the two never disagree. DuffingTransmon has no offset-charge concept of its own to translate, so the reconstructed transmon is built at the charge sweet spot ng=0. Import-only in the other direction is already covered by TransmonMapping.

library: ClassVar[str | None] = 'scqubits'
source: ClassVar[str | None] = None
target

alias of DuffingTransmon

export_model(device, *, ncut=30, **opts)[source]

Convert quchip device into a third-party object.

Override to support export; overriding requires setting target. The base implementation raises NotImplementedError.

Parameters:
Return type:

Any

class quchip.interop.scqubits.devices.ZeroPiMapping[source]

Bases: ModelMapping

Map scqubits.ZeroPi to EigenbasisDevice (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 one obj.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.

source: ClassVar[str | None] = 'scqubits.ZeroPi'
target: ClassVar[type | None] = None
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:
  • obj (Any)

  • levels (int | None)

  • label (str | None)

  • noise_kwargs (Any)

Return type:

EigenbasisDevice

library: ClassVar[str | None] = 'scqubits'