quchip.engine.slh

Gough-James algebra on resolved SLH triples: series product, concatenation, feedback.

Every function returns a new ResolvedSLH on the same Hilbert space as its operands and does not change them. Hamiltonian corrections that a composition generates are appended as network-origin static terms. Scattering stays scalar. Traced values pass through the array module that they arrive in.

Functions

cascade_hamiltonian(products)

Return sum (L_d^dagger c L_u - h.c.) / 2i over (L_d, L_u, c) matrices on one space.

concatenate(*systems[, prefixes])

Place systems side by side with block-diagonal scattering.

feedback_reduce(slh, *, output, input)

Connect one output channel back into one input channel.

series_product(first, second)

Feed every output of first into the matching input of second.

Classes

CompiledChannel(exposure, coupling, reference)

One exposure of a compiled network with its couplings by port and its reference plane.

CompiledNetwork(channels, scattering, ...[, ...])

The Markovian core of a port network, compiled for one chip.

ModeResponse(label, ports, freq, weight, ...)

A removed harmonic pole attached to its original quantum-port locations.

quchip.engine.slh.series_product(first, second)[source]

Feed every output of first into the matching input of second.

Implements G1 ▷ G2 = (S2 S1, L2 + S2 L1, H1 + H2 + (L2† S2 L1 − h.c.) / 2i). Paired channels must agree in accessibility and carrier. Reference runs are joined leg by leg, so the outbound run of first and the inbound run of second must be empty.

Parameters:
  • first (ResolvedSLH) – Systems with equal channel counts on one Hilbert space.

  • second (ResolvedSLH) – Systems with equal channel counts on one Hilbert space.

Returns:

The cascaded system.

Return type:

ResolvedSLH

Raises:

ValueError – Channel counts differ, Hilbert spaces differ, or a joined leg carries a reference run.

quchip.engine.slh.concatenate(*systems, prefixes=None)[source]

Place systems side by side with block-diagonal scattering.

Implements G1 ⊞ G2 = (diag(S1, S2), (L1, L2), H1 + H2). Channel keys must stay unique. To rename each system’s keys as prefix/key, pass prefixes. Exposed channels are ordered before hidden channels.

Parameters:
  • *systems (ResolvedSLH) – One or more systems on one Hilbert space.

  • prefixes (sequence of str, optional) – One prefix per system.

Returns:

The concatenated system.

Return type:

ResolvedSLH

Raises:

ValueError – No systems, mismatched prefixes, duplicate keys, or differing Hilbert spaces.

quchip.engine.slh.feedback_reduce(slh, *, output, input)[source]

Connect one output channel back into one input channel.

For output x and input y with g = (1 − S_xy)⁻¹, this implements S̃ = S_x̄ȳ + S_x̄y g S_xȳ, L̃ = L_x̄ + S_x̄y g L_x and H̃ = H + ((Σ_j L_j† S_jy) g L_x − h.c.) / 2i. When x and y differ, the remaining input of x and output of y form one channel, keyed "<x>-><y>" and is placed at the earlier of the two positions.

Parameters:
  • slh (ResolvedSLH) – The system to close.

  • output (str or SLHChannel) – The output channel that is fed back and the input channel that receives it.

  • input (str or SLHChannel) – The output channel that is fed back and the input channel that receives it.

Returns:

The reduced system with one channel fewer.

Return type:

ResolvedSLH

Raises:
  • ValueError – The loop is concretely singular, the two channels differ in accessibility, or a closed leg carries a reference run.

  • KeyError – An unknown channel key.