# Cavity

Source: https://docs.q-ctrl.com/references/boulder-opal/boulderopal/superconducting/Cavity

```python
class boulderopal.superconducting.Cavity(dimension, frequency=None, kerr_coefficient=None, drive=None, name='cavity')
```

Class that stores all the physical system data for a cavity.

### Parameters
* **dimension** (*int*) – Number of dimensions of the Hilbert space of the cavity.
  Must be at least 2.
* **frequency** (*real* *or* *np.ndarray* *or* [*RealOptimizableSignal*](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/superconducting/RealOptimizableSignal.md#boulderopal.superconducting.RealOptimizableSignal) *or* [*RealOptimizableConstant*](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/superconducting/RealOptimizableConstant.md#boulderopal.superconducting.RealOptimizableConstant) *,* *optional*) – The frequency of the cavity or None, $\omega_c$.
  If not provided, it defaults to no frequency term.
* **kerr_coefficient** (*real* *or* *np.ndarray* *or* [*RealOptimizableSignal*](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/superconducting/RealOptimizableSignal.md#boulderopal.superconducting.RealOptimizableSignal) *or*             [*RealOptimizableConstant*](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/superconducting/RealOptimizableConstant.md#boulderopal.superconducting.RealOptimizableConstant) *or* *None* *,* *optional*) – The nonlinearity of the cavity, $K$.
  If not provided, it defaults to no nonlinear term.
* **drive** (*real* *or* *complex* *or* *np.ndarray* *or* [*RealOptimizableSignal*](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/superconducting/RealOptimizableSignal.md#boulderopal.superconducting.RealOptimizableSignal) *or*             [*RealOptimizableConstant*](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/superconducting/RealOptimizableConstant.md#boulderopal.superconducting.RealOptimizableConstant) *or* [*ComplexOptimizableSignal*](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/superconducting/ComplexOptimizableSignal.md#boulderopal.superconducting.ComplexOptimizableSignal) *or*             [*ComplexOptimizableConstant*](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/superconducting/ComplexOptimizableConstant.md#boulderopal.superconducting.ComplexOptimizableConstant) *or* *None* *,* *optional*) – The complex drive of the cavity, $\gamma_c$.
  If not provided, it defaults to no drive term.
* **name** (*str* *,* *optional*) – The identifier of the cavity that is used to link interaction terms to this cavity.
  Defaults to “cavity”.

### SEE ALSO
[`boulderopal.superconducting.CavityCavityInteraction`](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/superconducting/CavityCavityInteraction.md#boulderopal.superconducting.CavityCavityInteraction)
: Class describing interactions between two cavities.

[`boulderopal.superconducting.Transmon`](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/superconducting/Transmon.md#boulderopal.superconducting.Transmon)
: Class describing transmons in superconducting systems.

[`boulderopal.superconducting.TransmonCavityInteraction`](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/superconducting/TransmonCavityInteraction.md#boulderopal.superconducting.TransmonCavityInteraction)
: Class describing interactions between a transmon and a cavity.

## Notes

The Hamiltonian for the cavity is defined as

$$
H_\mathrm{cavity} =
    \omega_c a^\dagger a
    + \frac{K}{2} (a^\dagger)^2 a^2
    + \frac{1}{2} \left(\gamma_c a^\dagger + H.c. \right) ,
$$

where $H.c.$ indicates the Hermitian conjugate.
All coefficients in the Hamiltonian are optional,
and you should only pass those relevant to your system.
