QuTiP
oqd_trical.backend.qutip
¶
QutipBackend
¶
Bases: BackendBase
Backend for running simulation of AtomicCircuit with QuTiP
Attributes:
Name | Type | Description |
---|---|---|
save_intermediate |
bool
|
Whether compiler saves the intermediate representation of the atomic circuit |
approx_pass |
PassBase
|
Pass of approximations to apply to the system. |
solver |
Literal[SESolver, MESolver]
|
QuTiP solver to use. |
solver_options |
Dict[str, Any]
|
Qutip solver options |
intermediate |
AtomicEmulatorCircuit
|
Intermediate representation of the atomic circuit during compilation |
Source code in oqd-trical/src/oqd_trical/backend/qutip/base.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
|
compile(circuit, fock_cutoff, *, relabel=True)
¶
Compiles a AtomicCircuit or AtomicEmulatorCircuit to a QutipExperiment
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
circuit
|
Union[AtomicCircuit, AtomicEmulatorCircuit]
|
circuit to be compiled. |
required |
fock_cutoff
|
int
|
Truncation for fock spaces. |
required |
Returns:
Name | Type | Description |
---|---|---|
experiment |
QutipExperiment
|
Compiled |
hilbert_space |
Dict[str, int]
|
Hilbert space of the system. |
Source code in oqd-trical/src/oqd_trical/backend/qutip/base.py
run(experiment, hilbert_space, timestep, *, initial_state=None)
¶
Runs a QutipExperiment
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
experiment
|
QutipExperiment
|
|
required |
hilbert_space
|
Dict[str, int]
|
Hilbert space of the system. |
required |
timestep
|
float
|
Timestep between tracked states of the evolution. |
required |
Returns:
Name | Type | Description |
---|---|---|
result |
Dict[str, Any]
|
Result of execution of |
Source code in oqd-trical/src/oqd_trical/backend/qutip/base.py
QutipCodeGeneration
¶
Bases: ConversionRule
Rule that converts an AtomicEmulatorCircuit
to a QutipExperiment
Attributes:
Name | Type | Description |
---|---|---|
hilbert_space |
Dict[str, int]
|
Hilbert space of the system. |
Source code in oqd-trical/src/oqd_trical/backend/qutip/codegen.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
QutipVM
¶
Bases: RewriteRule
Rule that executes a QutipExperiment
.
Attributes:
Name | Type | Description |
---|---|---|
hilbert_space |
Dict[str, int]
|
Hilbert space of the system. |
timestep |
float
|
Timestep between tracked states of the evolution. |
solver |
Literal[SESolver, MESolver]
|
QuTiP solver to use. |
solver_options |
Dict[str, Any]
|
Qutip solver options |
Source code in oqd-trical/src/oqd_trical/backend/qutip/vm.py
base
¶
QutipBackend
¶
Bases: BackendBase
Backend for running simulation of AtomicCircuit with QuTiP
Attributes:
Name | Type | Description |
---|---|---|
save_intermediate |
bool
|
Whether compiler saves the intermediate representation of the atomic circuit |
approx_pass |
PassBase
|
Pass of approximations to apply to the system. |
solver |
Literal[SESolver, MESolver]
|
QuTiP solver to use. |
solver_options |
Dict[str, Any]
|
Qutip solver options |
intermediate |
AtomicEmulatorCircuit
|
Intermediate representation of the atomic circuit during compilation |
Source code in oqd-trical/src/oqd_trical/backend/qutip/base.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
|
compile(circuit, fock_cutoff, *, relabel=True)
¶
Compiles a AtomicCircuit or AtomicEmulatorCircuit to a QutipExperiment
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
circuit
|
Union[AtomicCircuit, AtomicEmulatorCircuit]
|
circuit to be compiled. |
required |
fock_cutoff
|
int
|
Truncation for fock spaces. |
required |
Returns:
Name | Type | Description |
---|---|---|
experiment |
QutipExperiment
|
Compiled |
hilbert_space |
Dict[str, int]
|
Hilbert space of the system. |
Source code in oqd-trical/src/oqd_trical/backend/qutip/base.py
run(experiment, hilbert_space, timestep, *, initial_state=None)
¶
Runs a QutipExperiment
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
experiment
|
QutipExperiment
|
|
required |
hilbert_space
|
Dict[str, int]
|
Hilbert space of the system. |
required |
timestep
|
float
|
Timestep between tracked states of the evolution. |
required |
Returns:
Name | Type | Description |
---|---|---|
result |
Dict[str, Any]
|
Result of execution of |
Source code in oqd-trical/src/oqd_trical/backend/qutip/base.py
codegen
¶
QutipCodeGeneration
¶
Bases: ConversionRule
Rule that converts an AtomicEmulatorCircuit
to a QutipExperiment
Attributes:
Name | Type | Description |
---|---|---|
hilbert_space |
Dict[str, int]
|
Hilbert space of the system. |
Source code in oqd-trical/src/oqd_trical/backend/qutip/codegen.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
interface
¶
QutipExperiment
¶
Bases: TypeReflectBaseModel
Class representing a qutip experiment represented in terms of atomic operations expressed in terms of their Hamiltonians.
Attributes:
Name | Type | Description |
---|---|---|
base |
Operator
|
Free Hamiltonian. |
sequence |
List[AtomicEmulatorGate]
|
List of gates to apply. |
Source code in oqd-trical/src/oqd_trical/backend/qutip/interface.py
QutipGate
¶
Bases: TypeReflectBaseModel
Class representing a qutip gate represented in terms of atomic operations expressed in terms of their Hamiltonians.
Attributes:
Name | Type | Description |
---|---|---|
hamiltonian |
Operator
|
Hamiltonian to evolve by. |
duration |
float
|
Time to evolve for. |
Source code in oqd-trical/src/oqd_trical/backend/qutip/interface.py
vm
¶
QutipVM
¶
Bases: RewriteRule
Rule that executes a QutipExperiment
.
Attributes:
Name | Type | Description |
---|---|---|
hilbert_space |
Dict[str, int]
|
Hilbert space of the system. |
timestep |
float
|
Timestep between tracked states of the evolution. |
solver |
Literal[SESolver, MESolver]
|
QuTiP solver to use. |
solver_options |
Dict[str, Any]
|
Qutip solver options |