quchip.interop.scqubits.composite

Composite import from scqubits HilbertSpace to quchip Chip.

An scqubits HilbertSpace bundles subsystems and the InteractionTerm couplings between them. import_hilbertspace() imports each subsystem through the shipped device mappings (quchip.interop.scqubits.devices), keeping the order and using each subsystem’s id_str as the device label. It then transcribes every InteractionTerm into a callable-form Coupling. The coupling’s operator matrices are the term’s subsystem operators, expressed in the gauge of the imported device they act on.

An imported HilbertSpace is a frozen snapshot of the source’s truncated subsystem model. Each subsystem becomes an EigenbasisDevice, and the interaction factors stay in that same source eigenbasis. This reproduces the scqubits truncation and gauge exactly, without a second projection path. Importing an individual supported device still reconstructs the live differentiable quchip model from its circuit parameters.

The import translates only pairwise InteractionTerm products of two operators. Each term’s operator matrices are a frozen snapshot at the source parameter point, so the coupling is not differentiable with respect to the source circuit parameters. EigenbasisDevice carries the same frozen-snapshot contract. InteractionTermStr string expressions and non-pairwise products raise NotImplementedError, and the import does not make a partial model. The import converts subsystem energies and interaction strengths from the current scqubits unit, scqubits.get_units(), to GHz, and the export converts them back.

Functions

export_chip(chip, **opts)

Export a quchip Chip to an scqubits HilbertSpace.

import_hilbertspace(hs, **opts)

Import an scqubits HilbertSpace into a quchip Chip.

quchip.interop.scqubits.composite.import_hilbertspace(hs, **opts)[source]

Import an scqubits HilbertSpace into a quchip Chip.

Each subsystem is frozen at its source truncation, keeping its order and id_str. Each InteractionTerm becomes a callable-form Coupling in the same eigenbasis gauge.

Parameters:
  • hs (scqubits.HilbertSpace) – Composite system to import.

  • **opts (Any) – frame and approximation are forwarded to Chip, but device-level options are not. Every subsystem imports at its own truncated_dim and native noise defaults.

Raises:

NotImplementedError – A string-expression (InteractionTermStr) or non-pairwise interaction term is present.

quchip.interop.scqubits.composite.export_chip(chip, **opts)[source]

Export a quchip Chip to an scqubits HilbertSpace.

Each device exports through the shipped device mappings (quchip.interop.scqubits.devices) in chip order. Every Coupling factorizes into a scalar strength and two device operators. The export adds these as one InteractionTerm per edge. scqubits carries each subsystem’s bare diagonal energies (gauge-invariant) and these interaction matrices. The full composite is therefore in one consistent gauge, quchip’s, and its dressed spectrum reproduces the chip’s.

The export uses the complete operator form of each coupling. scqubits interaction terms are bare operator products with no approximation strategy of their own. So if a chip’s RWA() strategy filters a Capacitive, TunableCapacitive, or product-form Coupling, the export fails closed with ValueError. Silently exporting the full form would reproduce different physics than the chip’s resolved dynamics. CrossKerr is exempt because n̂_a n̂_b conserves the excitation number and stays unchanged under RWA(). Resolve or clone the chip with Exact before export.

Chip-level control equipment and baths have no scqubits counterpart, because scqubits models neither drives nor dissipation. The export drops them with one UserWarning that names the dropped items.

Parameters:
  • chip (Chip) – The composite system to export. Coupling strengths must be concrete, and a strength carrying a JAX tracer raises ValueError.

  • **opts (Any) – Any supplied key raises TypeError.

Raises:
  • NotImplementedError – The chip has a PortNetwork, retained effective terms, or intrinsic time-dependent Hamiltonians, or a coupling is not a Capacitive, TunableCapacitive, CrossKerr, or product-form Coupling.

  • ValueError – A coupling strength is a JAX tracer rather than a concrete value, or RWA filters a Capacitive/TunableCapacitive/product-form Coupling (see above).

  • LookupError – A device has no registered scqubits export mapping.

  • TypeError – You pass an unexpected keyword option (composite export accepts none).