utils#
Data#
Keeps track of a scalar time series, typically an observable (e.g. energy) recorded once per optimization or time-evolution step. |
Array#
Whether the input array is sharded across more than one device. |
|
Place the array on all devices, sharded along its first dimension. |
|
Place a full copy of the array on every device. |
|
Convert a distributed global array into the host-local array holding only this process's shards, using |
|
Assemble the host-local arrays of all processes into a single global array sharded along its first dimension (see |
|
Assemble identical host-local arrays into a global array replicated on every device (see |
|
Gather a (possibly distributed) array into a contiguous numpy array holding the full data, identical on every process. |
|
Extend the array. |
|
Equivalent to |
Pytree#
Return the array given by |
|
The same as |
|
Split a pytree potentially with complex values to two real pytrees, one for the real part and the other for the imaginary part. |
|
Combine two real pytrees to a complex one. |
|
Similar to equinox.apply_updates, but the original data type of the model is kept unchanged. |
Manipulating functions#
f -> jit(chunk_map(vmap(f), use_scan=True)) |
|
Convert a vmapped function to a function with chunked batches and parallel computation on all available machines. |
Customized arrays for large numbers#
Log-amplitude representation of JAX arrays: value = sign * exp(logabs) where |
|
Array representation with a scale: value = significand * exp(exponent), where exponent is a normalization factor. |
Basis states#
Converts QuSpin basis integers to int8 state array. |
|
Converts state array to QuSpin basis integers. |
|
Return a single neel state with alternating spins. |
|
Return a single stripe state. |
|
Spin structure factor \(\left< \frac{1}{2 \sqrt{N}} S^z_r S^z_0 e^{-iqr} \right>\) |
|
Random basis states. |