utils
JAX Utils
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
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |
set_precision(precision)
Set the precision of JAX operations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
precision
|
Literal['single', 'double']
|
'single' or 'double' |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
if precision is not 'single' or 'double' |
Source code in jaxquantum/utils/utils.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | |