Qutip
oqd_analog_emulator.qutip_backend
¶
QutipBackend
¶
Bases: BackendBase
Class representing the Qutip backend
Source code in oqd-analog-emulator/src/oqd_analog_emulator/qutip_backend.py
compile(task: Task)
¶
Method for compiling program of task to a QutipExperiment
and converting
args of task to [TaskArgsAnalog
][oqd_core.backend.task.TaskArgsAnalog].
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task
|
Task
|
Quantum experiment to compile |
required |
Returns:
Name | Type | Description |
---|---|---|
converted_circuit |
QutipExperiment
|
QutipExperiment containing the compiled experiment for Qutip |
converted_args |
TaskArgsQutip
|
args of analog layer are converted to args for QuTip. |
Source code in oqd-analog-emulator/src/oqd_analog_emulator/qutip_backend.py
run(task: Task)
¶
Method to simulate an experiment using the QuTip backend
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task
|
Optional[Task]
|
Run experiment from a [ |
required |
Returns:
Type | Description |
---|---|
TaskResultAnalog object containing the simulation results. |
Note
only one of task or experiment must be provided.
Source code in oqd-analog-emulator/src/oqd_analog_emulator/qutip_backend.py
oqd_analog_emulator.interface
¶
TaskArgsQutip
¶
Bases: VisitableBaseModel
Class representing args for QuTip
Attributes:
Name | Type | Description |
---|---|---|
layer |
str
|
the layer of the experiment (analog, atomic) |
n_shots |
Union[int, None]
|
number of shots requested |
fock_cutof |
int
|
fock_cutoff for QuTip simulation |
dt |
float
|
timesteps for discrete time |
metrics |
dict
|
metrics which should be computed for the experiment. This does not require any Measure instruction in the analog layer. |
Source code in oqd-analog-emulator/src/oqd_analog_emulator/interface.py
QutipOperation
¶
Bases: VisitableBaseModel
Class representing a quantum operation in QuTip
Attributes:
Name | Type | Description |
---|---|---|
hamiltonian |
List[Qobj, str]
|
Hamiltonian to evolve by |
duration |
float
|
Duration of the evolution |
Source code in oqd-analog-emulator/src/oqd_analog_emulator/interface.py
QutipExperiment
¶
Bases: VisitableBaseModel
Class representing a quantum experiment in qutip
Attributes:
Name | Type | Description |
---|---|---|
instructions |
List[QutipOperation]
|
List of quantum operations to apply |
n_qreg |
NonNegativeInt
|
Number of qubit quantum registers |
n_qmode |
NonNegativeInt
|
Number of modal quantum registers |
args |
TaskArgsQutip
|
Arguments for the experiment |