jaxquantum
jaxquantum
Qarray
Source code in jaxquantum/core/qarray.py
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 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 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 |
|
header
property
Print the header of the Qarray.
__deepcopy__(memo)
Need to override this when defininig getattr.
Source code in jaxquantum/core/qarray.py
435 436 437 438 439 440 441 442 |
|
__len__()
Length of the Qarray.
Source code in jaxquantum/core/qarray.py
251 252 253 254 255 256 |
|
__truediv__(other)
For Qarray's, this only really makes sense in the context of division by a scalar.
Source code in jaxquantum/core/qarray.py
319 320 321 322 323 324 325 |
|
from_array(qarr_arr)
classmethod
Create a Qarray from a nested list of Qarrays.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qarr_arr
|
list
|
nested list of Qarrays |
required |
Returns:
Name | Type | Description |
---|---|---|
Qarray |
Qarray
|
Qarray object |
Source code in jaxquantum/core/qarray.py
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 |
|
from_list(qarr_list)
classmethod
Create a Qarray from a list of Qarrays.
Source code in jaxquantum/core/qarray.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
|
reshape_bdims(*args)
Reshape the batch dimensions of the Qarray.
Source code in jaxquantum/core/qarray.py
193 194 195 196 197 198 199 200 201 202 203 204 205 |
|
reshape_qdims(*args)
Reshape the quantum dimensions of the Qarray.
Note that this does not take in qdims but rather the new Hilbert space dimensions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*args
|
new Hilbert dimensions for the Qarray. |
()
|
Returns:
Name | Type | Description |
---|---|---|
Qarray |
reshaped Qarray. |
Source code in jaxquantum/core/qarray.py
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 |
|
resize(new_shape)
Resize the Qarray to a new shape.
TODO: review and maybe deprecate this method.
Source code in jaxquantum/core/qarray.py
239 240 241 242 243 244 245 246 247 248 249 |
|
basis(N, k)
Creates a |k> (i.e. fock state) ket in a specified Hilbert Space.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
N
|
int
|
Hilbert space dimension |
required |
k
|
int
|
fock number |
required |
Returns:
Type | Description |
---|---|
Fock State |k> |
Source code in jaxquantum/core/operators.py
162 163 164 165 166 167 168 169 170 171 172 |
|
basis_like(A, ks)
Creates a |k> (i.e. fock state) ket with the same space dims as A.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
A
|
Qarray
|
state or operator. |
required |
k
|
fock number. |
required |
Returns:
Type | Description |
---|---|
Qarray
|
Fock State |k> with the same space dims as A. |
Source code in jaxquantum/core/operators.py
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 |
|
coherent(N, α)
Coherent state.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
N
|
int
|
Hilbert Space Size. |
required |
α
|
complex
|
coherent state amplitude. |
required |
Return
Coherent state |α⟩.
Source code in jaxquantum/core/operators.py
175 176 177 178 179 180 181 182 183 184 185 |
|
collapse(qarr, mode='sum')
Collapse the Qarray.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qarr
|
Qarray
|
quantum array array |
required |
Returns:
Type | Description |
---|---|
Qarray
|
Collapsed quantum array |
Source code in jaxquantum/core/qarray.py
543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 |
|
comb(N, k)
NCk
TODO: replace with jsp.special.comb once issue is closed:
https://github.com/google/jax/issues/9709
Parameters:
Name | Type | Description | Default |
---|---|---|---|
N
|
total items |
required | |
k
|
of items to choose |
required |
Returns:
Name | Type | Description |
---|---|---|
NCk |
N choose k |
Source code in jaxquantum/utils/utils.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
cosm(qarr)
Matrix cosine wrapper.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qarr
|
Qarray
|
quantum array |
required |
Returns:
Type | Description |
---|---|
Qarray
|
matrix cosine |
Source code in jaxquantum/core/qarray.py
744 745 746 747 748 749 750 751 752 753 754 755 |
|
cosm_data(data, **kwargs)
Matrix cosine wrapper.
Returns:
Type | Description |
---|---|
Array
|
matrix cosine |
Source code in jaxquantum/core/qarray.py
735 736 737 738 739 740 741 |
|
create(N)
creation operator
Parameters:
Name | Type | Description | Default |
---|---|---|---|
N
|
Hilbert space size |
required |
Returns:
Type | Description |
---|---|
Qarray
|
creation operator in Hilber Space of size N |
Source code in jaxquantum/core/operators.py
98 99 100 101 102 103 104 105 106 107 |
|
dag(qarr)
Conjugate transpose.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qarr
|
Qarray
|
quantum array |
required |
Returns:
Type | Description |
---|---|
Qarray
|
conjugate transpose of qarr |
Source code in jaxquantum/core/qarray.py
876 877 878 879 880 881 882 883 884 885 886 887 888 889 |
|
dag_data(arr)
Conjugate transpose.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
arr
|
Array
|
operator |
required |
Returns:
Type | Description |
---|---|
Array
|
conjugate of op, and transposes last two axes |
Source code in jaxquantum/core/qarray.py
892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 |
|
destroy(N)
annihilation operator
Parameters:
Name | Type | Description | Default |
---|---|---|---|
N
|
Hilbert space size |
required |
Returns:
Type | Description |
---|---|
Qarray
|
annilation operator in Hilber Space of size N |
Source code in jaxquantum/core/operators.py
86 87 88 89 90 91 92 93 94 95 |
|
displace(N, α)
Displacement operator
Parameters:
Name | Type | Description | Default |
---|---|---|---|
N
|
Hilbert Space Size |
required | |
α
|
Phase space displacement |
required |
Returns:
Type | Description |
---|---|
Qarray
|
Displace operator D(α) |
Source code in jaxquantum/core/operators.py
145 146 147 148 149 150 151 152 153 154 155 156 |
|
eigenenergies(qarr)
Eigenvalues of a quantum array.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qarr
|
Qarray
|
quantum array |
required |
Returns:
Type | Description |
---|---|
Array
|
eigenvalues |
Source code in jaxquantum/core/qarray.py
821 822 823 824 825 826 827 828 829 830 831 832 |
|
eigenstates(qarr)
Eigenstates of a quantum array.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qarr
|
Qarray
|
quantum array |
required |
Returns:
Type | Description |
---|---|
Qarray
|
eigenvalues and eigenstates |
Source code in jaxquantum/core/qarray.py
794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 |
|
expm(qarr, **kwargs)
Matrix exponential wrapper.
Returns:
Type | Description |
---|---|
Qarray
|
matrix exponential |
Source code in jaxquantum/core/qarray.py
700 701 702 703 704 705 706 707 708 |
|
expm_data(data, **kwargs)
Matrix exponential wrapper.
Returns:
Type | Description |
---|---|
Array
|
matrix exponential |
Source code in jaxquantum/core/qarray.py
691 692 693 694 695 696 697 |
|
extract_dims(arr, dims=None)
Extract dims from a JAX array or Qarray.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
arr
|
Array
|
JAX array or Qarray. |
required |
dims
|
Optional[Union[DIMS_TYPE, List[int]]]
|
Qarray dims. |
None
|
Returns:
Type | Description |
---|---|
Qarray dims. |
Source code in jaxquantum/core/conversions.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
|
fidelity(rho, sigma)
Fidelity between two states.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rho
|
Qarray
|
state. |
required |
sigma
|
Qarray
|
state. |
required |
Returns:
Type | Description |
---|---|
float
|
Fidelity between rho and sigma. |
Source code in jaxquantum/core/measurements.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
get_logical_basis(n_qubits)
Compute a complete operator basis of a system composed of logical qubits.
Args:
n_qubits: number of qubits
Returns:
List containing the complete operator basis.
Source code in jaxquantum/core/measurements.py
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 |
|
get_physical_basis(qubits)
Compute a complete operator basis of a QEC code on a physical system specified by a number of qubits.
Args:
qubits: list of qubit codes, must have
common_gates and params attributes.
Returns:
List containing the complete operator basis.
Source code in jaxquantum/core/measurements.py
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 |
|
hadamard()
H
Returns:
Name | Type | Description |
---|---|---|
H |
Qarray
|
Hadamard gate |
Source code in jaxquantum/core/operators.py
42 43 44 45 46 47 48 |
|
identity(*args, **kwargs)
Identity matrix.
Returns:
Type | Description |
---|---|
Qarray
|
Identity matrix. |
Source code in jaxquantum/core/operators.py
122 123 124 125 126 127 128 |
|
identity_like(A)
Identity matrix with the same shape as A.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
A
|
Matrix. |
required |
Returns:
Type | Description |
---|---|
Qarray
|
Identity matrix with the same shape as A. |
Source code in jaxquantum/core/operators.py
131 132 133 134 135 136 137 138 139 140 141 142 |
|
is_dm_data(data)
Check if data is a density matrix.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
Array
|
matrix |
required |
Returns: True if data is a density matrix
Source code in jaxquantum/core/qarray.py
933 934 935 936 937 938 939 940 941 |
|
jnp2jqt(arr, dims=None)
JAX array -> QuTiP state.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
jnp_obj
|
JAX array. |
required | |
dims
|
Optional[Union[DIMS_TYPE, List[int]]]
|
Qarray dims. |
None
|
Returns:
Type | Description |
---|---|
QuTiP state. |
Source code in jaxquantum/core/conversions.py
79 80 81 82 83 84 85 86 87 88 89 90 |
|
jqt2qt(jqt_obj)
Qarray -> QuTiP state.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
jqt_obj
|
Qarray. |
required | |
dims
|
QuTiP dims. |
required |
Returns:
Type | Description |
---|---|
QuTiP state. |
Source code in jaxquantum/core/conversions.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|
ket2dm(qarr)
Turns ket into density matrix. Does nothing if already operator.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qarr
|
Qarray
|
qarr |
required |
Returns:
Type | Description |
---|---|
Qarray
|
Density matrix |
Source code in jaxquantum/core/qarray.py
910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 |
|
mesolve(H, rho0, tlist, c_ops=None, solver_options=None)
Quantum Master Equation solver.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
H
|
Union[Qarray, Callable[[float], Qarray]]
|
time dependent Hamiltonian function or time-independent Qarray. |
required |
rho0
|
Qarray
|
initial state, must be a density matrix. For statevector evolution, please use sesolve. |
required |
tlist
|
Array
|
time list |
required |
c_ops
|
Optional[Qarray]
|
qarray list of collapse operators |
None
|
solver_options
|
Optional[SolverOptions]
|
SolverOptions with solver options |
None
|
Returns:
Type | Description |
---|---|
Qarray
|
list of states |
Source code in jaxquantum/core/solvers.py
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 |
|
num(N)
Number operator
Parameters:
Name | Type | Description | Default |
---|---|---|---|
N
|
Hilbert Space size |
required |
Returns:
Type | Description |
---|---|
Qarray
|
number operator in Hilber Space of size N |
Source code in jaxquantum/core/operators.py
110 111 112 113 114 115 116 117 118 119 |
|
overlap(rho, sigma)
Overlap between two states or operators.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rho
|
Qarray
|
state/operator. |
required |
sigma
|
Qarray
|
state/operator. |
required |
Returns:
Type | Description |
---|---|
Array
|
Overlap between rho and sigma. |
Source code in jaxquantum/core/measurements.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
plot_qp(state, pts, ax=None, contour=True, qp_type=WIGNER, cbar_label='', axis_scale_factor=1, plot_cbar=True)
Plot quasi-probability distribution.
TODO: decouple this from qutip.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
statevector |
required | |
pts
|
points to evaluate quasi-probability distribution on |
required | |
dim
|
dimensions of state |
required | |
ax
|
matplotlib axis to plot on |
None
|
|
contour
|
make the plot use contouring |
True
|
|
qp_type
|
type of quasi probability distribution ("wigner", "qfunc") |
WIGNER
|
Returns:
Type | Description |
---|---|
axis on which the plot was plotted. |
Source code in jaxquantum/core/visualization.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 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 |
|
powm(qarr, n)
Matrix power.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qarr
|
Qarray
|
quantum array |
required |
n
|
int
|
power |
required |
Returns:
Type | Description |
---|---|
Qarray
|
matrix power |
Source code in jaxquantum/core/qarray.py
711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 |
|
powm_data(data, n)
Matrix power.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
Array
|
matrix |
required |
n
|
int
|
power |
required |
Returns:
Type | Description |
---|---|
Array
|
matrix power |
Source code in jaxquantum/core/qarray.py
944 945 946 947 948 949 950 951 952 953 954 |
|
ptrace(qarr, indx)
Partial Trace.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rho
|
density matrix |
required | |
indx
|
index of quantum object to keep, rest will be partial traced out |
required |
Returns:
Type | Description |
---|---|
Qarray
|
partial traced out density matrix |
TODO: Fix weird tracing errors that arise with reshape
Source code in jaxquantum/core/qarray.py
838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 |
|
qt2jqt(qt_obj, dtype=jnp.complex128)
QuTiP state -> Qarray.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qt_obj
|
QuTiP state. |
required | |
dtype
|
JAX dtype. |
complex128
|
Returns:
Type | Description |
---|---|
Qarray. |
Source code in jaxquantum/core/conversions.py
22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
quantum_state_tomography(rho, physical_basis, logical_basis)
Perform quantum state tomography to retrieve the density matrix in the logical basis.
Args:
rho: state expressed in the physical Hilbert space basis.
physical_basis: list of logical operators expressed in the physical
Hilbert space basis forming a complete logical operator basis.
logical_basis: list of logical operators expressed in the
logical Hilbert space basis forming a complete operator basis.
Returns:
Density matrix of state rho expressed in the logical basis.
Source code in jaxquantum/core/measurements.py
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 |
|
qubit_rotation(theta, nx, ny, nz)
Single qubit rotation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
theta
|
float
|
rotation angle. |
required |
nx
|
rotation axis x component. |
required | |
ny
|
rotation axis y component. |
required | |
nz
|
rotation axis z component. |
required |
Returns:
Type | Description |
---|---|
Qarray
|
Single qubit rotation operator. |
Source code in jaxquantum/core/operators.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
|
sesolve(H, rho0, tlist, solver_options=None)
Schrödinger Equation solver.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
H
|
Union[Qarray, Callable[[float], Qarray]]
|
time dependent Hamiltonian function or time-independent Qarray. |
required |
rho0
|
Qarray
|
initial state, must be a density matrix. For statevector evolution, please use sesolve. |
required |
tlist
|
Array
|
time list |
required |
solver_options
|
Optional[SolverOptions]
|
SolverOptions with solver options |
None
|
Returns:
Type | Description |
---|---|
Qarray
|
list of states |
Source code in jaxquantum/core/solvers.py
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
|
sigmam()
σ-
Returns:
Type | Description |
---|---|
Qarray
|
σ- Pauli Operator |
Source code in jaxquantum/core/operators.py
51 52 53 54 55 56 57 |
|
sigmap()
σ+
Returns:
Type | Description |
---|---|
Qarray
|
σ+ Pauli Operator |
Source code in jaxquantum/core/operators.py
60 61 62 63 64 65 66 |
|
sigmax()
σx
Returns:
Type | Description |
---|---|
Qarray
|
σx Pauli Operator |
Source code in jaxquantum/core/operators.py
15 16 17 18 19 20 21 |
|
sigmay()
σy
Returns:
Type | Description |
---|---|
Qarray
|
σy Pauli Operator |
Source code in jaxquantum/core/operators.py
24 25 26 27 28 29 30 |
|
sigmaz()
σz
Returns:
Type | Description |
---|---|
Qarray
|
σz Pauli Operator |
Source code in jaxquantum/core/operators.py
33 34 35 36 37 38 39 |
|
sinm_data(data, **kwargs)
Matrix sine wrapper.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
Array
|
matrix |
required |
Returns:
Type | Description |
---|---|
Array
|
matrix sine |
Source code in jaxquantum/core/qarray.py
758 759 760 761 762 763 764 765 766 767 |
|
solve(f, ρ0, tlist, args, solver_options=None)
Gets teh desired solver from diffrax.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
solver_options
|
Optional[SolverOptions]
|
dictionary with solver options |
None
|
Returns:
Type | Description |
---|---|
solution |
Source code in jaxquantum/core/solvers.py
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 |
|
tensor(*args, **kwargs)
Tensor product.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*args
|
Qarray
|
tensors to take the product of |
()
|
parallel
|
bool
|
if True, use parallel einsum for tensor product true: [A,B] ^ [C,D] = [A^C, B^D] false: [A,B] ^ [C,D] = [A^C, A^D, B^C, B^D] |
required |
Returns:
Type | Description |
---|---|
Qarray
|
Tensor product of given tensors |
Source code in jaxquantum/core/qarray.py
618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 |
|
thermal(N, beta)
Thermal state.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
N
|
int
|
Hilbert Space Size. |
required |
beta
|
float
|
thermal state inverse temperature. |
required |
Return
Thermal state.
Source code in jaxquantum/core/operators.py
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 |
|
tr(qarr, **kwargs)
Full trace.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qarr
|
Qarray
|
quantum array |
required |
Returns:
Type | Description |
---|---|
Array
|
Full trace. |
Source code in jaxquantum/core/qarray.py
665 666 667 668 669 670 671 672 673 674 675 676 |
|
trace(qarr, **kwargs)
Full trace.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qarr
|
Qarray
|
quantum array |
required |
Returns:
Type | Description |
---|---|
Array
|
Full trace. |
Source code in jaxquantum/core/qarray.py
679 680 681 682 683 684 685 686 687 688 |
|
transpose(qarr, indices)
Transpose the quantum array.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qarr
|
Qarray
|
quantum array |
required |
*args
|
axes to transpose |
required |
Returns:
Type | Description |
---|---|
Qarray
|
tranposed Qarray |
Source code in jaxquantum/core/qarray.py
560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 |
|
unit(qarr)
Normalize the quantum array.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qarr
|
Qarray
|
quantum array |
required |
Returns:
Type | Description |
---|---|
Qarray
|
Normalized quantum array |
Source code in jaxquantum/core/qarray.py
592 593 594 595 596 597 598 599 600 601 602 603 |
|