QuantumSession

The QuantumSession class is the main interface class.

class QuantumSession(api_key: str = None, storage_path='temp/')

Bases: object

If api_key is None, it will resort to the saved key on the system…

clear_numpy_waveforms()
close()
declare_numpy_waveform(wfm_name, numpy_array)
download_bundle(job_id: str, path: str | Path | None = None) → Path

GET /jobs/{id}/artifacts/bundle — download hardware result zip.

Fetches the job then calls Job.download_bundle.

get_final_qasm()
get_qregs_in_qasm()
get_qubit_freq_from_amplitude(qubit_name, flux_amplitude)
get_qubit_names()
get_qubit_params(qubit_name)
get_results_by_uuid(uuid: str)
list_backends(print_table=True) → list[Backend]
load_qasm(file_path: str)
reconnect(api_key='')

If api_key is blank, it will resort to the saved key on the system…

run(auto_validate=True, dont_download_raw=False)
select_backend(leBackend: Backend | str)
set_acquisition_type(acq_type: str) → None

Set hardware acquisition_type (Discrimination | Integration | Raw).

set_averaging_type(averaging: str) → None

Set hardware averaging (AverageRepetitions | SingleShotCounts).

set_num_shots(num_shots: int)
set_qasm(qasm_script: str)
set_qreg_physical_mapping(mapping: dict)

A dictionary that maps the qreg to the physical qubit index. For example, q[0] mapped onto $1 becomes the key-value pair (q,0):1. An empty dictionary implies that it is the default mapping (order of qregs defined map onto the physical qubits directly)

set_readout_states(readout_states: str) → None

Set hardware readout_states (ReadoutGE | ReadoutGEF).

set_shot_repeat(shot_repeat: int) → None

Set the number of software repeats for hardware execution.

validate(print_output=True)