Skip to content

Losses

cymyc.approx.losses ¤

Objective functions and diagnostics for approximation of metrics of vanishing Ricci curvature on Calabi-Yaus.

monge_ampere_loss(g_pred: Complex[Array, 'cy_dim cy_dim'], dVol_Omega: Float[Array, ''], kappa: float = 1.0, norm_order: float = 1.0) -> jnp.ndarray ¤

Computes the integrand of the Monge-Ampère loss,

\[ \mathcal{L}_{\textsf{MA}} := \int_X \left\Vert 1 - \frac{1}{\kappa} \frac{\det g}{\Omega \wedge \overline{\Omega}} \right\Vert^p d\mu_{\Omega}~. \]

This enforces the condition that \(\omega^n \propto \Omega \wedge \bar{\Omega}\) up to some constant \(\kappa \in \mathbb{C}\), which is a consequence of Ricci-flatness.

Parameters:

Name Type Description Default
g_pred Complex[Array, "dim dim"]

Predicted metric \(g_{\mu \overline{\nu}}\) in local coordinates.

required
dVol_Omega Float[Array, '']

\(\Omega \wedge \bar{\Omega}\) in local coordinates.

required
kappa float

Proportionality constant between the canonical volume form and volume form induced by g_pred.

1.0
norm_order float

Order of norm of loss, by default 1.

1.0

Returns:

Type Description
ndarray

Computed Monge-Ampère loss.

Notes

The parameter \(\kappa \in \mathbb{C}\) denotes the constant of proportionality between \(\Omega \wedge \overline{\Omega}\) and the volume form \(\bigwedge^n \tilde{\omega}\) induced by the approximate Kähler form \(\tilde{\omega}\). In general, $$ \bigwedge^n \omega = h(z) \, \Omega \wedge \overline{\Omega} ~,$$ for some holomorphic function \(h\), but \(h\) is constant for the Ricci-flat Kaehler form. Supply this if this is known beforehand, e.g. for an ansatz which remains cohomologous to some known known reference metric.

ricci_tensor_loss(p: Float[Array, i], metric_fn: Callable[[Array], Array], pullbacks: Complex[Array, 'cy_dim i'] = None, ricci_scalar_out: bool = False, norm_order: float = None) -> Union[jnp.ndarray, Tuple[jnp.ndarray, jnp.ndarray]] ¤

Computes the norm of the Ricci tensor, in local coordinates. Here we use the fact that the Ricci curvature on a Kähler manifold is computable as, $$ \textsf{Ric} = \partial \overline{\partial} \log \det g_{\mu \bar{\nu}}~. $$

The Ricci tensor loss is then given by \(\int_X \left\Vert \textsf{Ric} \right\Vert^p d\mu_{\Omega}\).

Parameters:

Name Type Description Default
p array_like

2 * complex_dim real coords at which fun is evaluated. Shape [i].

required
metric_fn callable

Function representing metric tensor in local coordinates \(g : \mathbb{R}^m -> \mathbb{C}^{a,b...}\).

required
pullbacks array_like

Pullback matrices from ambient to projective variety. If supplied, computes Ricci curvature on variety.

None
ricci_scalar_out bool

Toggle to output Ricci scalar, default False.

False
norm_order Optional[float]

Order of the norm, default None (corresponding to 2-norm).

None

Returns:

Type Description
Union[ndarray, Tuple[ndarray, ndarray]]

Computed Ricci tensor loss, and optionally Ricci scalar.

See Also

curvature.ricci_form_kahler, curvature.ricci_tensor_kahler.

kahler_loss(p: Float[Array, i], pullbacks: Complex[Array, 'cy_dim i'], metric_fn: Callable[[Array], Array], norm_order: float = 2) -> jnp.ndarray ¤

Computes the integrand of the condition arising from the closedness of the Kähler form \(\omega\), $$ d\omega = 0 \implies g_{\mu \overline{\nu}, \rho} = g_{\rho \overline{\nu}, \mu}~, $$ with a similar condition for the antiholomorphic derivative. See Nakahara (8.82), page 331 for more details. Note this should be exactly zero for the FS metric + {exact correction}!

Parameters:

Name Type Description Default
p array_like

2 * complex_dim real coordinates at which metric_fn is evaluated. Shape [i].

required
pullbacks array_like

Pullback matrices from ambient to projective variety.

required
metric_fn callable

Function representing the metric tensor in local coordinates \(g : \mathbb{R}^m -> \mathbb{C}^{a,b...}\).

required
norm_order float

Order of norm, by default 2.

2

Returns:

Type Description
ndarray

Computed Kähler loss.

volume_loss(data: Tuple[ArrayLike, ArrayLike, ArrayLike], g_FS_pb: jnp.ndarray, g_pred: jnp.ndarray, norm_order: float = 1) -> jnp.ndarray ¤

Computes the discrepancy between the volume computed using the respective volume forms constructed from the Fubini-Study metric and predicted metric. As the corresponding Kähler forms are cohomologous, this should be zero.

\[ \mathcal{L}_{\text{vol}} = \left\Vert \textsf{vol}_{\text{FS}} - \textsf{vol}_{\text{CY}} \right\Vert^p~, \quad \textsf{vol}_g := \int_X d^nx \, \det g~. \]

Parameters:

Name Type Description Default
data Tuple[ArrayLike, ArrayLike, ArrayLike]

Tuple containing input points, integration weights and canonical volume form \(\Omega \wedge \bar{\Omega}\) in local coords.

required
g_FS_pb ndarray

Pullback of the Fubini-Study metric.

required
g_pred ndarray

Predicted metric in local coordinates.

required
norm_order float

Order of norm, default 1.

1

Returns:

Type Description
ndarray

Computed volume loss.

objective_function(data: Tuple[ArrayLike, ArrayLike, ArrayLike], params: Mapping[str, Array], metric_fn: Callable[[ArrayLike], jnp.ndarray], kappa: Optional[float] = None) -> jnp.ndarray ¤

Default objective function for optimisation of Ricci-flat metrics, using only the Monge-Ampère loss.

Parameters:

Name Type Description Default
data Tuple[ArrayLike, ArrayLike, ArrayLike]

Tuple containing input points, integration weights, and canonical volume form \(\Omega \wedge \bar{\Omega}\) in local coordinates.

required
params Mapping[Str, Array]

Model parameters stored as a dictionary - keys are the module names registered upon initialisation and values are the parameter values.

required
metric_fn Callable[[ArrayLike], ndarray]

Function representing metric tensor in local coordinates, \(g : \mathbb{R}^m -> \mathbb{C}^{a,b...}\).

required
kappa float

Proportionality constant between the canonical volume form and volume form induced by approximate metric.

None

Returns:

Type Description
ndarray

Computed objective function value.

ma_proportionality(p, weights, config) ¤

Calculates proportionality constant between the rival volume forms \(\Omega \wedge \bar{\Omega}\) and \(\omega^n\).