Curvature
cymyc.curvature
¤
Calculation of various curvature-related quantities for a general Kahler manifold \(X\). This module may also be used to compute curvature information on a real manifold without complex structure, by omitting the imaginary part of the local coordinates for \(p \in X\).
Note the following:
- Curvature quantities involve \(n\)-th order derivatives of some generic function
fun
. These are computed with autodiff - a good usage pattern is to make a partial closure to bind all arguments tofun
except the coordinate dependence. - These functions expect local coordinates
z
in ac_dim
-dimensional space, with the real and imaginary parts concatenated to form a real-valued2*c_dim
vector,p = [Re(z); Im(z)]
.
Info
When transforming functions which compute derivatives of some fun
passed as an input, you will need to either:
- In the case of
jit
, specify thatfun
is a static argument. - Wrap
fun
in ajax.tree_util.Partial
closure to make it compatible with Jax transformations.
See the below example.
Example
import jax
import jax.numpy as jnp
fun = lambda x: jnp.sum(jnp.cos(x))
>>> jax.jit(del_z, static_argnums=(1,))(p, fun) # ok
>>> jax.jit(del_z)(p, jax.tree_util.Partial(fun)) # ok
>>> jax.jit(del_z)(p, fun) # TypeError
del_z(p: Float[Array, i], fun: Callable[[Float[Array, ...]], Array], *args) -> Complex[Array, '... i']
¤
Holomorphic derivative of a function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
p |
array_like
|
2 * |
required |
fun |
callable
|
Locally defined function fun: \(\mathbb{R}^m -> \mathbb{C}^{a,b,c...}\) sending real-valued inputs to complex-valued outputs |
required |
Returns:
Name | Type | Description |
---|---|---|
dfun_dz |
array_like
|
Holomorphic derivative of |
Notes
Computes holomorphic Wirtinger derivative, w.r.t. complex \(p = x + iy\).
Examples:
>>> p = jnp.ones((8,))
>>> fun = lambda x: jnp.sum(jnp.cos(x))
>>> del_z(p, fun)
Array([-0.42073548+0.42073548j, -0.42073548+0.42073548j,
-0.42073548+0.42073548j, -0.42073548+0.42073548j], dtype=complex64)
del_bar_z(p: Float[Array, i], fun: Callable[[Float[Array, ...]], Array], *args) -> Complex[Array, '... i']
¤
Anti-holomorphic derivative of a function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
p |
array_like
|
2 * |
required |
fun |
callable
|
Locally defined function fun: \(\mathbb{R}^m -> \mathbb{C}^{a,b,c...}\) sending real-valued inputs to complex-valued outputs |
required |
Returns:
Name | Type | Description |
---|---|---|
dfun_dz_bar |
array_like
|
Anti-holomorphic derivative of |
del_z_bar_del_z(p: Float[Array, i], fun: Callable[[Float[Array, ...]], Array], *args, wide: bool = False) -> Complex[Array, '... i i']
¤
Computes the composition \(\partial \circ \overline{\partial}\) of a given function. Note this coincides with the Hessian \(\nabla df\) on a complex manifold.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
p |
array_like
|
2 * |
required |
fun |
callable
|
Locally defined function fun: \(\mathbb{R}^m -> \mathbb{C}^{a,b,c...}\) sending real-valued inputs to complex-valued outputs |
required |
wide |
bool
|
Flag to use reverse-mode autodiff if function is wide, i.e. if the output of
|
False
|
Returns:
Name | Type | Description |
---|---|---|
dfun_dz_bar_dz |
array_like
|
\(\bar{\partial} \partial f\). Shape [..., \mu, \bar{\nu}]. Note holomorphic index comes first. |
christoffel_symbols_kahler(p: Float[Array, i], metric_fn: Callable[[Array], Array], pullbacks: Complex[Array, 'cy_dim i'] = None) -> Complex[Array, 'j j j']
¤
Returns holomorphic Levi-Civita connection coefficients, with optional support for variety \(\iota: X \hookrightarrow \mathbb{P}^n\). Schematically, if \(g\) is the metric tensor, $$ \Gamma \sim g^{-1} \cdot \partial g~. $$
Parameters:
Name | Type | Description | Default |
---|---|---|---|
p |
array_like
|
2 * |
required |
metric_fn |
callable
|
Function representing metric tensor in local coordinates \(g : \mathbb{R}^m -> \mathbb{C}^{a,b...}\). |
required |
Returns:
Name | Type | Description |
---|---|---|
gamma_holo |
array_like
|
Holomorphic Christoffel symbols of the Kahler metric. \(\Gamma^{\lambda}_{\mu \nu}\). Shape [...,k,i,j], symmetric in (i,j). The Kahler conditions imply \(\Gamma^{\lambda}_{\mu \nu}\) and its conjugate are the only nonzero connection coeffs. |
Other Parameters:
Name | Type | Description |
---|---|---|
pullbacks |
array_like
|
Pulllback matrices from ambient to projective variety. If supplied, computes Christoffels on the variety. |
riemann_tensor_kahler(p: Float[Array, i], metric_fn: Callable[[Array], Array], pullbacks: Complex[Array, 'cy_dim i'] = None, return_aux: bool = False) -> Complex[Array, 'j j j j'] | Sequence[Array]
¤
Returns Riemann curvature tensor on a Kähler manifold, with optional support for variety \(\iota: X \hookrightarrow \mathbb{P}^n\).
This can also be used to construct the Riemann tensor on a real manifold by omission of the imaginary part of p
. Schematically,
$$
\textsf{Riem} \sim \partial \Gamma + \Gamma \Gamma ~.
$$
Parameters:
Name | Type | Description | Default |
---|---|---|---|
p |
array_like
|
2 * |
required |
metric_fn |
callable
|
Function representing metric tensor in local coordinates \(g : \mathbb{R}^m -> \mathbb{C}^{a,b...}\). Warning This function explicitly instantiates the complex Hessian of |
required |
Returns:
Name | Type | Description |
---|---|---|
riemann |
array_like
|
(1,3) Riemann tensor corresponding to the Kahler connection \(R^{\kappa}_{\lambda \mu \overline{\nu}}\). See page 335, (8.97) of Nakahara. |
Other Parameters:
Name | Type | Description |
---|---|---|
pullbacks |
array_like
|
Pulllback matrices from ambient to projective variety. If supplied, computes Riemann tensor on the variety. |
ricci_tensor_kahler(p: Float[Array, i], metric_fn: Callable[[Array], Array], pullbacks: Complex[Array, 'cy_dim i'] = None) -> Complex[Array, 'j j']
¤
Returns Ricci curvature tensor on a Kähler manifold, with optional support for variety \(\iota: X \hookrightarrow \mathbb{P}^n\).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
p |
array_like
|
2 * |
required |
metric_fn |
callable
|
Function representing metric tensor in local coordinates \(g : \mathbb{R}^m -> \mathbb{C}^{a,b...}\). |
required |
Returns:
Name | Type | Description |
---|---|---|
ricci |
array_like
|
(0,2) Ricci tensor corresponding to the Kahler connection $ R_{\mu \bar{\nu}}$. |
Other Parameters:
Name | Type | Description |
---|---|---|
pullbacks |
array_like
|
Pulllback matrices from ambient to projective variety. If supplied, computes Ricci tensor on the variety. |
See Also
ricci_form_kahler
: Computes Ricci form as \(\partial_{\mu} \overline{\partial}_{\overline{\nu}} \log g\).
ricci_form_kahler(p: Float[Array, i], metric_fn: Callable[[Array], Array], pullbacks: Complex[Array, 'cy_dim i'] = None) -> Complex[Array, 'j j']
¤
Returns Ricci form \(\rho\) on a Kähler manifold, with support for variety \(\iota: X \hookrightarrow \mathbb{P}^n\). Componentwise, \(\rho_{\mu\bar{\nu}} = i R_{\mu \bar{\nu}}\), and $$ \rho = \partial \overline{\partial} \log \det g~. $$
Parameters:
Name | Type | Description | Default |
---|---|---|---|
p |
array_like
|
2 * |
required |
metric_fn |
callable
|
Function representing metric tensor in local coordinates \(g : \mathbb{R}^m -> \mathbb{C}^{a,b...}\). |
required |
Returns:
Name | Type | Description |
---|---|---|
ricci |
array_like
|
(1,1) Ricci form corresponding to the Kahler connection $ R_{\mu \bar{\nu}}$. |
Other Parameters:
Name | Type | Description |
---|---|---|
pullbacks |
array_like
|
Pulllback matrices from ambient to projective variety. If supplied, computes Ricci tensor on the variety. |
ricci_scalar(p: Float[Array, i], metric_fn: Callable[[Array], Array], pullbacks: Complex[Array, 'cy_dim i'] = None) -> Complex[Array, '']
¤
Returns Ricci scalar on a Kähler manifold, with support for variety \(\iota: X \hookrightarrow \mathbb{P}^n\).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
p |
array_like
|
2 * |
required |
metric_fn |
callable
|
Function representing metric tensor in local coordinates \(g : \mathbb{R}^m -> \mathbb{C}^{a,b...}\). |
required |
Returns:
Name | Type | Description |
---|---|---|
R |
array_like
|
Ricci scalar, \(R = g^{\mu \bar{\nu}}R_{\mu \bar{\nu}}\). Shape [...] |
Other Parameters:
Name | Type | Description |
---|---|---|
pullbacks |
array_like
|
Pulllback matrices from ambient to projective variety. If supplied, computes Ricci tensor on the variety. |