# boulderopalscaleup.experiments.TWPAReadoutOptimization

Source: https://docs.q-ctrl.com/references/boulder-opal-scale-up/boulderopalscaleup/experiments/TWPAReadoutOptimization

```python
class boulderopalscaleup.experiments.TWPAReadoutOptimization(*, resonator, twpa, pump_frequencies, pump_powers_dbm, qubits=None, parallel=False, measure_waveform=None, duration_ns=16000, recycle_delay_ns=200000, shot_count=1000, run_mixer_calibration=False, update='auto')
```

Optimize TWPA pump parameters for maximum qubit readout fidelity.

Sweeps TWPA pump frequency and power while measuring qubit-state-resolved
readout fidelity for all qubits on the TWPA’s feedline. Selects the pump
point that maximizes mean classification fidelity across qubits.

### Variables
* **resonator** (*str*) – The reference resonator (used to identify the feedline).
* **twpa** (*str*) – The name of the TWPA element (e.g. ‘twpa0’, ‘twpa1’, ‘twpa2’).
* **pump_frequencies** ([*LinspaceIterable*](https://docs.q-ctrl.com/references/boulder-opal-scale-up/boulderopalscaleup/common/LinspaceIterable.md#boulderopalscaleup.common.LinspaceIterable) *or* [*RangeIterable*](https://docs.q-ctrl.com/references/boulder-opal-scale-up/boulderopalscaleup/common/RangeIterable.md#boulderopalscaleup.common.RangeIterable) *or* [*CWSIterable*](https://docs.q-ctrl.com/references/boulder-opal-scale-up/boulderopalscaleup/common/CWSIterable.md#boulderopalscaleup.common.CWSIterable)) – The TWPA pump frequencies to sweep, in Hz.
* **pump_powers_dbm** ([*LinspaceIterable*](https://docs.q-ctrl.com/references/boulder-opal-scale-up/boulderopalscaleup/common/LinspaceIterable.md#boulderopalscaleup.common.LinspaceIterable) *or* [*RangeIterable*](https://docs.q-ctrl.com/references/boulder-opal-scale-up/boulderopalscaleup/common/RangeIterable.md#boulderopalscaleup.common.RangeIterable) *or* [*CWSIterable*](https://docs.q-ctrl.com/references/boulder-opal-scale-up/boulderopalscaleup/common/CWSIterable.md#boulderopalscaleup.common.CWSIterable)) – The TWPA pump powers to sweep, in dBm.
* **qubits** (*list* *[* *str* *] or* *None* *,* *optional*) – The qubits to optimize. If None, all qubits on the feedline will be
  optimized. Defaults to None.
* **parallel** (*bool* *,* *optional*) – Whether to prepare and measure all selected qubits simultaneously under
  a shared TWPA pump pulse. Defaults to False (each individual qubit
  optimized sequentially).
* **measure_waveform** ([*ConstantWaveform*](https://docs.q-ctrl.com/references/boulder-opal-scale-up/boulderopalscaleup/common/ConstantWaveform.md#boulderopalscaleup.common.ConstantWaveform) *or* *None* *,* *optional*) – The waveform for the measurement pulse. Defaults to the measure defcal.
* **duration_ns** (*int* *,* *optional*) – Duration of the TWPA pump tone in nanoseconds. Defaults to 16,000 ns.
* **recycle_delay_ns** (*int* *,* *optional*) – Delay between consecutive shots, in nanoseconds. Defaults to 200,000 ns.
* **shot_count** (*int* *,* *optional*) – Number of shots per state per point. Defaults to 1,000.
* **run_mixer_calibration** (*bool* *,* *optional*) – Whether to run mixer calibration. Defaults to False.
* **update** ( *"auto"* *or*  *"off"* *or*  *"prompt"* *,* *optional*) – How the device should be updated. Defaults to “auto”.
