base
Base device.
Device
Bases: ABC
Source code in jaxquantum/devices/base/base.py
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 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
|
common_ops()
abstractmethod
Set up common ops in the specified basis.
Source code in jaxquantum/devices/base/base.py
148 149 150 |
|
create(N, params, label=0, N_pre_diag=None, use_linear=False, hamiltonian=None, basis=None)
classmethod
Create a device.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
N
|
int
|
dimension of Hilbert space. |
required |
params
|
dict
|
parameters of the device. |
required |
label
|
int
|
label for the device. Defaults to 0. This is useful when you have multiple of the same device type in the same system. |
0
|
N_pre_diag
|
int
|
dimension of Hilbert space before diagonalization. Defaults to None, in which case it is set to N. This must be greater than or rqual to N. |
None
|
use_linear
|
bool
|
whether to use the linearized device. Defaults to False. This will override the hamiltonian keyword argument. This is a bit redundant with hamiltonian, but it is kept for backwards compatibility. |
False
|
hamiltonian
|
HamiltonianTypes
|
type of Hamiltonian. Defaults to None, in which case the full hamiltonian is used. |
None
|
basis
|
BasisTypes
|
type of basis. Defaults to None, in which case the fock basis is used. |
None
|
Source code in jaxquantum/devices/base/base.py
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 |
|
get_H()
Return diagonalized H. Explicitly keep only diagonal elements of matrix.
Source code in jaxquantum/devices/base/base.py
164 165 166 167 168 169 170 |
|
get_H_full()
abstractmethod
Return full H.
Source code in jaxquantum/devices/base/base.py
160 161 162 |
|
get_H_linear()
abstractmethod
Return linear terms in H.
Source code in jaxquantum/devices/base/base.py
156 157 158 |
|
get_linear_ω()
abstractmethod
Get frequency of linear terms.
Source code in jaxquantum/devices/base/base.py
152 153 154 |
|
param_validation(N, N_pre_diag, params, hamiltonian, basis)
classmethod
This can be overridden by subclasses.
Source code in jaxquantum/devices/base/base.py
79 80 81 82 |
|