Resonator
Quantum LC resonator / microwave cavity with Fock space truncation.
- class HybridSuperQubits.resonator.Resonator(frequency, dimension)[source]
Bases:
QubitBaseClass representing a quantum LC resonator (cavity).
This class models a simple harmonic oscillator, which is the fundamental building block for modeling quantum cavities, transmission line resonators, and other linear resonant structures in circuit QED.
- PARAM_LABELS: dict[str, str] = {'dimension': '$N_{\\mathrm{fock}}$', 'f0': '$f_0$', 'frequency': '$\\omega_0/2\\pi$'}
- OPERATOR_LABELS: dict[str, str] = {'a_operator': '\\hat{a}', 'adag_operator': '\\hat{a}^\\dagger', 'momentum_operator': '\\hat{p}', 'n_operator': '\\hat{n}', 'position_operator': '\\hat{x}'}
- property f0: float
Returns the resonance frequency.
- Returns:
Resonance frequency in GHz.
- Return type:
- property omega0: float
Returns the angular frequency.
- Returns:
Angular frequency in rad/s.
- Return type:
- property zpf_voltage: float
Returns the zero-point fluctuation voltage scale. For a transmission line resonator with characteristic impedance Z0.
- Returns:
Zero-point fluctuation voltage scale.
- Return type:
- property zpf_current: float
Returns the zero-point fluctuation current scale.
- Returns:
Zero-point fluctuation current scale.
- Return type:
- n_operator()[source]
Returns the number operator.
- Returns:
The number operator matrix.
- Return type:
np.ndarray
- a_operator()[source]
Returns the annihilation operator.
- Returns:
The annihilation operator matrix.
- Return type:
np.ndarray
- adag_operator()[source]
Returns the creation operator.
- Returns:
The creation operator matrix.
- Return type:
np.ndarray
- position_operator()[source]
Returns the position operator (dimensionless).
For a transmission line resonator, this corresponds to the voltage fluctuations normalized by the zero-point voltage.
- Returns:
The position operator matrix.
- Return type:
np.ndarray
- momentum_operator()[source]
Returns the momentum operator (dimensionless).
For a transmission line resonator, this corresponds to the current fluctuations normalized by the zero-point current.
- Returns:
The momentum operator matrix.
- Return type:
np.ndarray
- hamiltonian()[source]
Returns the Hamiltonian for the resonator.
H = ħω₀(a†a + 1/2)
- Returns:
The Hamiltonian matrix in GHz units.
- Return type:
np.ndarray
- thermal_state(temperature)[source]
Calculate the thermal state density matrix.
- Parameters:
temperature (float) – Temperature in Kelvin.
- Returns:
Thermal state density matrix.
- Return type:
np.ndarray
- coherent_state(alpha)[source]
Generate a coherent state |α⟩.
- Parameters:
alpha (complex) – Coherent state amplitude.
- Returns:
Coherent state vector.
- Return type:
np.ndarray
- fock_state(n)[source]
Generate a Fock state |n⟩.
- Parameters:
n (int) – Fock state number.
- Returns:
Fock state vector.
- Return type:
np.ndarray
- wavefunction(which=0, x_grid=None, esys=None)[source]
Calculate the wavefunction in position representation.
- Parameters:
which (int, optional) – Index of the eigenstate (default is 0 for ground state).
x_grid (np.ndarray, optional) – Position grid for wavefunction evaluation.
esys (Tuple[np.ndarray, np.ndarray], optional) – Eigenvalues and eigenvectors. If None, they will be calculated.
- Returns:
Dictionary containing position grid, wavefunction amplitudes, and energy.
- Return type:
Dict[str, Any]
- plot_wavefunction(which=0, x_grid=None, esys=None, scaling=1, mode='abs', **kwargs)[source]
Plot the wavefunction(s) in position representation.
- Parameters:
which (Union[int, Iterable[int]], optional) – Index or indices of the eigenstates to plot.
x_grid (np.ndarray, optional) – Position grid for wavefunction evaluation.
esys (Tuple[np.ndarray, np.ndarray], optional) – Eigenvalues and eigenvectors.
scaling (Optional[float], optional) – Scaling factor for wavefunction amplitude display.
mode (Literal["abs", "real", "imag"], optional) – Display mode: ‘abs’, ‘real’, or ‘imag’.
**kwargs – Additional plotting arguments.
- Returns:
Figure and axes objects.
- Return type:
Tuple[plt.Figure, plt.Axes]