geope.jax.dexpm¤
geope.jax.dexpm.Ui(x, basis)
¤
Compute a matrix from a linear combination of generators.
Constructs \(U = \exp(\sum_k x_k E_k)\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Array
|
Coefficient vector of shape |
required |
basis
|
Array
|
Generator array of shape |
required |
Returns:
| Type | Description |
|---|---|
Array
|
A matrix of shape |
geope.jax.dexpm.get_Ui_fn(basis)
¤
Create a partial gate function with a fixed generator array.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
basis
|
Array
|
Generator array of shape |
required |
Returns:
| Type | Description |
|---|---|
Callable[[Array], Array]
|
A callable that accepts a coefficient vector and returns the |
Callable[[Array], Array]
|
corresponding gate matrix. |
geope.jax.dexpm.dexpm_block(A, x)
¤
Compute the derivative of the matrix exponential via the block method.
Implements the block-matrix approach of
Al-Mohy & Higham (2009) <https://arxiv.org/pdf/1506.00628>_,
Eq. (31), extracting \(d\exp(A)/dA \cdot x\) from the upper-right
block of \(\exp([[A, x], [0, A]])\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
A
|
Array
|
The generator combination \(\sum_k x_k E_k\), of shape |
required |
x
|
Array
|
The direction matrix of shape |
required |
Returns:
| Type | Description |
|---|---|
Array
|
The directional derivative matrix of shape |
geope.jax.dexpm.dexpm(x, basis)
¤
Compute the derivative of the exponential map for all generator directions.
For each generator \(E_k\), computes \(\partial \exp(\sum_j x_j E_j) / \partial x_k\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Array
|
Coefficient vector of shape |
required |
basis
|
Array
|
Generator array of shape |
required |
Returns:
| Type | Description |
|---|---|
Array
|
An array of shape |
Array
|
partial derivatives with respect to each coefficient. |
geope.jax.dexpm.dexpm_batched(x, basis, batch_size)
¤
Batched derivative of the exponential map.
Same as dexpm but uses jax.lax.map with a configurable
batch_size to limit peak memory usage.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Array
|
Coefficient vector of shape |
required |
basis
|
Array
|
Generator array of shape |
required |
batch_size
|
int
|
Number of generators to process per batch. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
An array of shape |
geope.jax.dexpm.get_dexpm(basis, batch_size=None)
¤
Create a JIT-compiled exponential-map derivative function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
basis
|
Array
|
Generator array of shape |
required |
batch_size
|
int | None
|
Optional batch size. If |
None
|
Returns:
| Type | Description |
|---|---|
Callable[[Array], Array]
|
A callable that accepts a coefficient vector and returns |
Callable[[Array], Array]
|
the derivative array of shape |
The adjoint¤
The per-gate transpose of the above: all K overlaps of one covector with
dexpm's directions, from a single eigendecomposition and without ever forming
the (d, d, K) tensor. This is the step geope.jax.get_vjp_propagator is built
from.
geope.jax.dexpm.adj_expm_eig(x, b, basis, hermitian=True)
¤
Adjoint of the exponential-map derivative: all K overlaps, no (d, d, K).
Returns the vector of Frobenius overlaps of a single covector b with every
partial derivative of Ui,
which is what a chain rule through the exponential actually needs — the
(d, d, K) tensor dexpm_eig builds is contracted away immediately, and
building it first costs \(O(d^3 K)\) where this costs \(O(d^3 + d^2 K)\).
Writing \(M = \sum_j x_j E_j = V\,\mathrm{diag}(\mu)\,V^{-1}\) and \(\Delta\) for
the divided differences of \(\exp\), dexpm_eig gives
\(\partial_k e^M = V(\Delta \circ V^{-1}E_kV)V^{-1}\), so
The K directions therefore cost one \((K, d, d)\) tensordot against a single
\(d \times d\) matrix, and the two rotations that build \(\bar A\) are paid once.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Array
|
Coefficient vector of shape |
required |
b
|
Array
|
The covector to contract against, of shape |
required |
basis
|
Array
|
Generator array of shape |
required |
hermitian
|
bool
|
Assume a skew-Hermitian combination and diagonalise via
|
True
|
Returns:
| Type | Description |
|---|---|
Array
|
A complex |
Array
|
|
Array
|
(absolute-value) cost needs. |
geope.jax.dexpm.get_adj_expm_eig(basis, hermitian=True)
¤
Create a JIT-compiled spectral exponential-map adjoint.
Wraps adj_expm_eig with a fixed generator array. This is the per-gate step
geope.jax.get_vjp_propagator is built from.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
basis
|
Array
|
Generator array of shape |
required |
hermitian
|
bool
|
Assume a skew-Hermitian combination and use |
True
|
Returns:
| Type | Description |
|---|---|
Callable[[Array, Array], Array]
|
A callable accepting a coefficient vector |
Callable[[Array, Array], Array]
|
|
geope.jax.dexpm.adj_expm(x, b, basis)
¤
adj_expm_eig by the block-exponential route — the slow, general path.
The auxiliary-matrix method has no spectral structure to exploit, so this
genuinely does build dexpm's (d, d, K) tensor and contract it. It exists
for parity with method="block" elsewhere in this module, and because the
block method tolerates arbitrary generators; prefer adj_expm_eig.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Array
|
Coefficient vector of shape |
required |
b
|
Array
|
The covector to contract against, of shape |
required |
basis
|
Array
|
Generator array of shape |
required |
Returns:
| Type | Description |
|---|---|
Array
|
A complex |
geope.jax.dexpm.get_adj_expm(basis)
¤
Create a JIT-compiled block-method exponential-map adjoint.
Wraps adj_expm with a fixed generator array — the slow path, kept for
parity with method="block".
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
basis
|
Array
|
Generator array of shape |
required |
Returns:
| Type | Description |
|---|---|
Callable[[Array, Array], Array]
|
A callable accepting a coefficient vector |
Callable[[Array, Array], Array]
|
|