Overview
Superconductivity and the Higgs field two ways, from Richard Behiel's "Superconductivity and the Higgs Field". Pure Raya.
A 2-D lattice Ginzburg–Landau / abelian Higgs model (lattice.ray):
F = Σ_ℓ |ψ_j − U_ℓ ψ_i|² + Σ_i (αQ_i + (β/2)Q_i²) + (1/g²) Σ_p (1 − Re U_p h̄), Q = |\psi|^{2},
Gauge transformation \psi_{i} \to g_{i}\psi_{i}, U_ℓ → g_j U_ℓ ḡ_i. Two steppers: time-dependent GL (relax) and the Hamiltonian step (evolve, symplectic Euler, Gauss's law div E + 2 \operatorname{Im} \bar{\pi}\psi kept).
Classic (classic.ray, Transcendental) | Rational (Rational, Geometric) | |
|---|---|---|
| Links | angle \theta, \theta + = \Delta\theta, U = \cos \theta + i \sin \theta | U \leftarrow e(\tau)U, e(\tau) = \frac{(1 - \tau^{2}) + 2i\tau}{1 + \tau^{2}}, \tau = \frac{\Delta\theta}{2}; in doubles \frac{U(3 - Q)}{2} |
| Vortex / fluxoid | Σ atan2 / 2\pi | quarter turns by signs and one cross product (winding.ray): exact integer |
| Flux quantization | \sum \theta_{p} / 2\pi | holonomy W (= \prod U_{p} exactly), half-turn spread \frac{1 - \operatorname{Re} W}{2} = \sin^{2}(\frac{\pi\Phi}{\Phi_{0}}) |
| London | e^{-x/\lambda} | B_{n} = B_{0}r^{n}, r + \frac{1}{r} = 2 + \frac{1}{\lambda^{2}} (r: Root), \lambda^{2} = \frac{1}{2g^{2}Q_{0}} |
| Hat | \sqrt{-\frac{\alpha}{\beta}} e^{i\varphi} | V(Q) = \alpha Q + (\frac{\beta}{2})Q^{2}, Q_{0} = -\frac{\alpha}{\beta}, rim points like (\frac{3}{10}, \frac{2}{5}) |
| Electroweak | \theta_{W} = \operatorname{atan}(g'/g), m_{Z} = \frac{m_{W}}{\cos \theta_{W}} | s_{W} = \frac{g'^{2}}{g^{2} + g'^{2}}, \frac{m_{W}^{2}}{m_{Z}^{2}} = 1 - s_{W} |
exact.ray is the same model over any field (\mathbb{Q} with riptide_precision's Rational), rational way only. experiments.ray: the lab's runs (Meissner disc cooled by a growing front, type-II vortex entry, flux trapped in a ring, the Higgs strip). bin/gauge_probe.ray <preset> [steps] [classic] prints their readouts.
Functions and constants
Functions
(double, double) cayley(double t)The Cayley point e(t) = ((1 − t²) + 2it)/(1 + t^{2}) in doubles: (re, im).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// The Cayley point e(t) = ((1 − t²) + 2it)/(1 + t²): a U(1) phase with rational coordinates for rational t.
for (final t in [0.0, 0.5, 1.0, 2.0]) {
final (re, im) = cayley(t);
print('e($t) = ($re, $im), re² + im² = ${re * re + im * im}');
}
}e(0.0) = (1.0, 0.0), re² + im² = 1.0 e(0.5) = (0.6, 0.8), re² + im² = 1.0 e(1.0) = (0.0, 1.0), re² + im² = 1.0 e(2.0) = (-0.6, 0.8), re² + im² = 1.0
double turnRule(double t1, double t2)The turn rule: the parameter of e(t_{1}) \cdot e(t_{2}), \frac{t_{1} + t_{2}}{1 - t_{1}t_{2}} (infinite when t_{1}t_{2} = 1: the half turn -1).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// The turn rule: e(t₁)·e(t₂) = e((t₁ + t₂)/(1 − t₁t₂)), tangent addition with no angle.
const c = CayleyArith<Rational>(ExactArith());
Rational r(int n, [int d = 1]) => Rational.fromInt(n, d);
final (ar, ai) = c.point(r(1, 2));
final (br, bi) = c.point(r(1, 3));
final (pr, pi) = c.mul(ar, ai, br, bi);
print('turnRule(1/2, 1/3) = ${turnRule(0.5, 1 / 3)}');
print('e(1/2)·e(1/3) = ($pr, $pi) = e(1) = ${c.point(r(1))}');
}turnRule(1/2, 1/3) = 0.9999999999999999 e(1/2)·e(1/3) = (0, 1) = e(1) = (0, 1)
double halfTurnSpread(double re)The half-turn spread of a unit complex number (re, im): \frac{1 - re}{2}. Zero exactly when the phase is 1.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// The half-turn spread of a unit number: (1 − re)/2. Zero exactly when the phase is 1.
for (final t in [0.0, 0.5, 1.0, 3.0]) {
final (re, _) = cayley(t);
print('t = $t: halfTurnSpread = ${halfTurnSpread(re)} (t²/(1 + t²) = ${t * t / (1 + t * t)})');
}
}t = 0.0: halfTurnSpread = 0.0 (t²/(1 + t²) = 0.0) t = 0.5: halfTurnSpread = 0.2 (t²/(1 + t²) = 0.2) t = 1.0: halfTurnSpread = 0.5 (t²/(1 + t²) = 0.5) t = 3.0: halfTurnSpread = 0.9 (t²/(1 + t²) = 0.9)
double spreadOf(double re, double im)The spread between a unit complex number (re, im) and 1: \frac{im^{2}}{re^{2} + im^{2}}, which is im^{2} for a unit number.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// The spread of a unit number from 1: im²/(re² + im²) = 4t²/(1 + t²)².
for (final t in [0.5, 1.0, 2.0]) {
final (re, im) = cayley(t);
print('t = $t: spread = ${spreadOf(re, im)}, 4t²/(1 + t²)² = ${4 * t * t / ((1 + t * t) * (1 + t * t))}');
}
}t = 0.5: spread = 0.6400000000000001, 4t²/(1 + t²)² = 0.64 t = 1.0: spread = 1.0, 4t²/(1 + t²)² = 1.0 t = 2.0: spread = 0.6400000000000001, 4t²/(1 + t²)² = 0.64
double londonRatio(double lambda2)The lattice London decay ratio r (B_{n + 1} = r \cdot B_{n} into the sample): the root of r + \frac{1}{r} = 2 + \frac{1}{\lambda^{2}} below 1. Root: r = 1 + \frac{1}{2\lambda^{2}} - \sqrt{(1 + \frac{1}{2\lambda^{2}})^{2} - 1}.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// The lattice London decay ratio r < 1 with r + 1/r = 2 + 1/λ² (one square root).
for (final l2 in [1.0, 4.0, 9.0]) {
final r = londonRatio(l2);
print('λ² = $l2: r = ${r.toStringAsFixed(12)}, r + 1/r = ${(r + 1 / r).toStringAsFixed(12)}');
}
}λ² = 1.0: r = 0.381966011250, r + 1/r = 3.000000000000 λ² = 4.0: r = 0.609611796798, r + 1/r = 2.250000000000 λ² = 9.0: r = 0.717624303872, r + 1/r = 2.111111111111
double lambda2ForRatio(double r)The other way round, rational: choose the ratio r \in \mathbb{Q} and \lambda^{2} = \frac{r}{(1 - r)^{2}}.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// The other way round, rational: choose r and λ² = r/(1 − r)²; then londonRatio(λ²) gives r back.
for (final r in [0.5, 0.75, 0.8]) {
final l2 = lambda2ForRatio(r);
print('r = $r: λ² = $l2, londonRatio(λ²) = ${londonRatio(l2).toStringAsFixed(12)}');
}
}r = 0.5: λ² = 2.0, londonRatio(λ²) = 0.500000000000 r = 0.75: λ² = 12.0, londonRatio(λ²) = 0.750000000000 r = 0.8: λ² = 20.00000000000001, londonRatio(λ²) = 0.800000000000
double londonPowers(double b0, double r, int n)The lattice London profile with a rational ratio: B_{n} = B_{0} r^{n} (multiplications only).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// The lattice London profile B_n = B₀rⁿ with a rational r: multiplications only. Next to it, B₀e^{−x/λ}.
const r = 0.75;
final l2 = lambda2ForRatio(r);
print('r = 3/4: λ² = $l2');
print('B at n = 0…6: ${[for (var n = 0; n <= 6; n++) londonPowers(1, r, n)].join(', ')}');
}r = 3/4: λ² = 12.0 B at n = 0…6: 1.0, 0.75, 0.5625, 0.421875, 0.31640625, 0.2373046875, 0.177978515625
double latticeSpread(double u)The lattice wave's spread \frac{\hat{k}^{2}}{4} for the Cayley parameter u: \frac{u^{2}}{1 + u^{2}}.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// The lattice wave's spread u²/(1 + u²) for the Cayley parameter u.
for (final u in [0.0, 0.3, 1.0]) print('u = $u: spread = ${latticeSpread(u)}');
}u = 0.0: spread = 0.0 u = 0.3: spread = 0.08256880733944953 u = 1.0: spread = 0.5
double stepSpread(double dt, double mass2, double u)The leapfrog oscillator's per-step spread s = (\frac{dt^{2}}{4})(m^{2} + \hat{k}^{2}) (Rational): the discrete dispersion relation with no angle. Stable while s \le 1.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// The leapfrog oscillator's per-step spread s = (dt²/4)(m² + k̂²): the discrete dispersion relation, stable while s ≤ 1.
for (final (dt, m2, u) in [(0.25, 0.5, 0.3), (0.25, 0.0, 1.0), (1.0, 2.0, 1.0)]) {
final s = stepSpread(dt, m2, u);
print('dt = $dt, m² = $m2, u = $u: s = $s${s <= 1 ? '' : ' (unstable)'}');
}
}dt = 0.25, m² = 0.5, u = 0.3: s = 0.012973050458715597 dt = 0.25, m² = 0.0, u = 1.0: s = 0.03125 dt = 1.0, m² = 2.0, u = 1.0: s = 1.0
double redQuadrance(double omega, double k)The red quadrance \omega^{2} - k^{2} of (\omega, k) (chromogeometry): m^{2} on the mass shell, 0 on the light cone.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// The red quadrance ω² − k²: m² on the mass shell, 0 on the light cone.
print('(ω, k) = (5, 3): ${redQuadrance(5, 3)} (mass 4)');
print('(ω, k) = (2, 2): ${redQuadrance(2, 2)} (light)');
}
// Display only: ω for drawing the shells.
double _root(double q) {
if (q == 0) return 0;
var r = q;
for (var i = 0; i < 40; i++) r = (r + q / r) / 2;
return r;
}(ω, k) = (5, 3): 16.0 (mass 4) (ω, k) = (2, 2): 0.0 (light)
int quadrantOf(double re, double im)The quadrant of (re, im): 0 for re > 0, im \ge 0; 1 for re \le 0, im > 0; 2 for re < 0, im \le 0; 3 for re \ge 0, im < 0. -1 for the origin (no direction).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// The quadrant of (re, im), read off signs only; −1 for the origin.
for (final (r, i) in [(1.0, 0.0), (0.0, 1.0), (-1.0, -0.5), (0.3, -2.0), (0.0, 0.0)]) print('($r, $i) → ${quadrantOf(r, i)}');
}(1.0, 0.0) → 0 (0.0, 1.0) → 1 (-1.0, -0.5) → 2 (0.3, -2.0) → 3 (0.0, 0.0) → -1
int? quarterTurns(double ar, double ai, double br, double bi)Signed quarter turns from a to b along the straight segment (-2 \cdots 2); null if either is the origin.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// Signed quarter turns along a straight segment a → b; opposite quadrants decided by the cross product's sign.
print('(1, 0) → (0, 1): ${quarterTurns(1, 0, 0, 1)}');
print('(0, 1) → (1, 0): ${quarterTurns(0, 1, 1, 0)}');
print('(1, 0.1) → (−1, 0.2): ${quarterTurns(1, 0.1, -1, 0.2)} (cross > 0)');
print('(1, 0.1) → (−1, −0.2): ${quarterTurns(1, 0.1, -1, -0.2)} (cross < 0)');
print('to the origin: ${quarterTurns(1, 0, 0, 0)}');
}(1, 0) → (0, 1): 1 (0, 1) → (1, 0): -1 (1, 0.1) → (−1, 0.2): 1 (cross > 0) (1, 0.1) → (−1, −0.2): -2 (cross < 0) to the origin: null
int? windingOf(List<double> re, List<double> im)The winding number of the closed polygon through (rek, imk) around 0 (closed back to the first point), or null if a vertex is the origin. Exact for every input: only signs and one cross product per opposite-quadrant step.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// The winding number of a closed polygon around 0, by signs and one cross product per opposite-quadrant step.
final sq = (re: [1.0, -1.0, -1.0, 1.0], im: [1.0, 1.0, -1.0, -1.0]);
print('square around 0: ${windingOf(sq.re, sq.im)}');
final twice = [for (var k = 0; k < 8; k++) [sq.re[k % 4], sq.im[k % 4]]];
print('round twice: ${windingOf([for (final p in twice) p[0]], [for (final p in twice) p[1]])}');
print('reversed: ${windingOf(sq.re.reversed.toList(), sq.im.reversed.toList())}');
print('not around 0: ${windingOf([2.0, 3.0, 3.0], [1.0, 1.0, 2.0])}');
}square around 0: 1 round twice: 2 reversed: -1 not around 0: 0
int? windingOfExact<T>(List<T> re, List<T> im, {required int Function(T) sign, required T Function(T, T) mul, required T Function(T, T) sub})The same count over any ordered field, given its sign function (exact rationals: Rational.compareTo).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// The same count over exact rationals: give it sign, multiply and subtract. 20 powers of e(1/2) (each turn about 53°).
const c = CayleyArith<Rational>(ExactArith());
final re = <Rational>[], im = <Rational>[];
final (zr, zi) = c.point(Rational.fromInt(1, 2)); // 3/5 + 4/5 i
var p = (Rational.one, Rational.zero);
for (var k = 0; k < 20; k++) {
re.add(p.$1);
im.add(p.$2);
p = c.mul(p.$1, p.$2, zr, zi);
}
final n = windingOfExact<Rational>(re, im, sign: (x) => x.sign, mul: (a, b) => a * b, sub: (a, b) => a - b);
print('e(1/2)^k, k = 0…19, closed back to 1: winding = $n; |e^19|² = ${c.quadrance(re[19], im[19])}');
}e(1/2)^k, k = 0…19, closed back to 1: winding = 3; |e^19|² = 1
void anglesFromLinks(Float64List ur, Float64List ui, Float64List th)\theta_{l} = \operatorname{atan2}(Im U_{l}, \operatorname{Re} U_{l}): the classic way's angles from unit links (on switching ways).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
import 'package:riptide_rational_gauge/classic.ray';
import 'raya:typed_data';
void main() {
// θ_l = atan2(Im U_l, Re U_l): the classic way's angles, recovered from unit links.
final ur = Float64List.fromList([cayley(0.5).$1, -1, 0]), ui = Float64List.fromList([cayley(0.5).$2, 0, 1]);
final th = Float64List(3);
anglesFromLinks(ur, ui, th);
print('θ = ${th.map((x) => x.toStringAsFixed(9)).join(', ')}');
}θ = 0.927295218, 3.141592654, 1.570796327
void turnLinks(Float64List th, Float64List ur, Float64List ui, Float64List dth)The classic link turn: \theta_{l} + = \Delta\theta_{l}, U_{l} = e^{i\theta_{l}} = (\cos \theta_{l}, \sin \theta_{l}).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
import 'package:riptide_rational_gauge/classic.ray';
import 'raya:typed_data';
void main() {
// The classic link turn: θ += Δθ, then U = (cos θ, sin θ). Next to it the rational turn U ← e(Δθ/2)·U, 1000 turns each.
final th = Float64List(1), ur = Float64List.fromList([1]), ui = Float64List(1), d = Float64List.fromList([0.01]);
var rr = 1.0, ri = 0.0;
final (cr, ci) = cayley(0.005);
for (var k = 0; k < 1000; k++) {
turnLinks(th, ur, ui, d);
(rr, ri) = (cr * rr - ci * ri, cr * ri + ci * rr);
}
print('classic after 1000 turns: θ = ${th[0].toStringAsFixed(12)}, U = (${ur[0].toStringAsFixed(9)}, ${ui[0].toStringAsFixed(9)})');
print('rational (no renormalising): U = (${rr.toStringAsFixed(9)}, ${ri.toStringAsFixed(9)}), |U|² − 1 = ${(rr * rr + ri * ri - 1).toStringAsExponential(1)}');
}classic after 1000 turns: θ = 10.000000000000, U = (-0.839071529, -0.544021111) rational (no renormalising): U = (-0.839116861, -0.543951187), |U|² − 1 = 1.0e-13
(double, double) expI(double theta)e^{i\theta} = (\cos \theta, \sin \theta).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
import 'package:riptide_rational_gauge/classic.ray';
import 'raya:math' as math;
void main() {
// e^{iθ} = (cos θ, sin θ), next to the Cayley point for t = tan(θ/2).
for (final th in [0.5, 1.0, math.pi / 2]) {
final (c, s) = expI(th);
final (r, i) = cayley(math.tan(th / 2));
print('θ = ${th.toStringAsFixed(4)}: e^{iθ} = (${c.toStringAsFixed(12)}, ${s.toStringAsFixed(12)}), e(tan θ/2) = (${r.toStringAsFixed(12)}, ${i.toStringAsFixed(12)})');
}
}θ = 0.5000: e^{iθ} = (0.877582561890, 0.479425538604), e(tan θ/2) = (0.877582561890, 0.479425538604)
θ = 1.0000: e^{iθ} = (0.540302305868, 0.841470984808), e(tan θ/2) = (0.540302305868, 0.841470984808)
θ = 1.5708: e^{iθ} = (0.000000000000, 1.000000000000), e(tan θ/2) = (0.000000000000, 1.000000000000)double argOf(double re, double im)Arg z by atan2.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
import 'package:riptide_rational_gauge/classic.ray';
void main() {
// arg z by atan2: the angle of e(t) is 2·atan t.
for (final t in [0.5, 1.0, 2.0]) {
final (r, i) = cayley(t);
print('t = $t: arg e(t) = ${argOf(r, i).toStringAsFixed(12)}');
}
}t = 0.5: arg e(t) = 0.927295218002 t = 1.0: arg e(t) = 1.570796326795 t = 2.0: arg e(t) = 2.214297435588
int windingByAngles(List<double> re, List<double> im)The classic vortex count: n = \operatorname{round}((\frac{1}{2\pi}) \sum_{k} \arg(\frac{s_{k + 1}}{s_{k}})) round a closed polygon, each arg by atan2.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
import 'package:riptide_rational_gauge/classic.ray';
import 'raya:math' as math;
void main() {
// The classic vortex count: (1/2π)Σ arg(s_{k+1}/s_k) by atan2, rounded. It agrees with the exact sign count here.
final re = <double>[], im = <double>[];
for (var k = 0; k < 12; k++) {
final a = 2 * math.pi * 2 * k / 12; // round twice
re.add(math.cos(a) * (1 + 0.3 * (k % 3)));
im.add(math.sin(a) * (1 + 0.3 * (k % 3)));
}
print('by angles: ${windingByAngles(re, im)}, by signs: ${windingOf(re, im)}');
}by angles: 2, by signs: 2
double fluxQuanta(Iterable<(double, double)> plaquettes)\sum \theta_{p}: the flux of a set of plaquettes in units of the flux quantum, (\frac{1}{2\pi}) \sum \operatorname{atan2}(Im U_{p}, \operatorname{Re} U_{p}).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
import 'package:riptide_rational_gauge/classic.ray';
void main() {
// Σθ_p/2π over plaquettes: 8 plaquettes each with phase e(tan(π/8)) hold 8·(π/4)/(2π) = 1 quantum.
final t = 0.41421356237309503; // tan(π/8)
final p = cayley(t);
print('flux = ${fluxQuanta(List.filled(8, p)).toStringAsFixed(12)} quanta');
}flux = 1.000000000000 quanta
double londonProfile(double b0, double x, double lambda)London's profile B(x) = B_{0} e^{-x/\lambda}.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
import 'package:riptide_rational_gauge/classic.ray';
void main() {
// London's continuum profile B₀e^{−x/λ}, next to the lattice profile B₀rⁿ with the matching rational r.
const r = 0.75;
final lambda = 1 / _ln(1 / r); // the continuum λ with e^{−1/λ} = r, for comparison
print('x = 0…4: continuum ${[for (var x = 0; x <= 4; x++) londonProfile(1, x.toDouble(), lambda).toStringAsFixed(6)].join(', ')}');
print(' lattice ${[for (var n = 0; n <= 4; n++) londonPowers(1, r, n).toStringAsFixed(6)].join(', ')}');
}
double _ln(double x) {
// ln x by the series of atanh((x − 1)/(x + 1)), display only.
final y = (x - 1) / (x + 1);
var s = 0.0, p = y;
for (var k = 1; k < 60; k += 2) {
s += p / k;
p *= y * y;
}
return 2 * s;
}x = 0…4: continuum 1.000000, 0.750000, 0.562500, 0.421875, 0.316406
lattice 1.000000, 0.750000, 0.562500, 0.421875, 0.316406(double, double) weinberg(double g, double gp, double mW)The weak mixing angle \theta_{W} = \operatorname{atan}(g'/g) and m_{Z} = m_{W} / \cos \theta_{W}.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
import 'package:riptide_rational_gauge/classic.ray';
void main() {
// The classic weak mixing angle θ_W = atan(g′/g) and m_Z = m_W/cos θ_W, next to the spread s_W.
final (theta, mZ) = weinberg(0.652, 0.357, 80.2);
print('θ_W = ${theta.toStringAsFixed(9)} rad, m_Z = ${mZ.toStringAsFixed(6)} GeV');
print('spread s_W = ${Electroweak.standard.sW.toStringAsFixed(9)}');
}θ_W = 0.500957199 rad, m_Z = 91.435268 GeV spread s_W = 0.230654797
double carrier(double k, double x)The classic wave carrier cos(kx) for a gauge-field wave packet.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
import 'package:riptide_rational_gauge/classic.ray';
import 'raya:math' as math;
void main() {
// The classic wave carrier cos(kx); the rational side uses Re of the exact powers of e(u), u = tan(k/2).
const u = 0.3;
final k = 2 * math.atan(u);
var pr = 1.0, pi = 0.0;
final (zr, zi) = cayley(u);
for (var x = 0; x <= 4; x++) {
print('x = $x: cos(kx) = ${carrier(k, x.toDouble()).toStringAsFixed(12)}, Re e(u)^x = ${pr.toStringAsFixed(12)}');
(pr, pi) = (pr * zr - pi * zi, pr * zi + pi * zr);
}
}x = 0: cos(kx) = 1.000000000000, Re e(u)^x = 1.000000000000 x = 1: cos(kx) = 0.834862385321, Re e(u)^x = 0.834862385321 x = 2: cos(kx) = 0.393990404848, Re e(u)^x = 0.393990404848 x = 3: cos(kx) = -0.177006846951, Re e(u)^x = -0.177006846951 x = 4: cos(kx) = -0.689543121775, Re e(u)^x = -0.689543121775
(double, double) vacuum(double alpha, double beta, double phi)The classic vacuum: |\psi_{0}| = \sqrt{-\frac{\alpha}{\beta}} at the phase \varphi: |\psi_{0}| e^{i\varphi}.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
import 'package:riptide_rational_gauge/classic.ray';
import 'raya:math' as math;
void main() {
// The classic vacuum √(−α/β)·e^{iφ}; the rational lab instead picks a rational point on the rim, e.g. (3/10, 2/5).
final (r, i) = vacuum(-0.5, 2, math.atan2(0.4, 0.3));
print('classic: (${r.toStringAsFixed(12)}, ${i.toStringAsFixed(12)}), |ψ|² = ${(r * r + i * i).toStringAsFixed(12)}');
print('rational (3/10, 2/5): |ψ|² = ${Rational.fromInt(9, 100) + Rational.fromInt(16, 100)} = Q0 = −α/β = 1/4');
}classic: (0.300000000000, 0.400000000000), |ψ|² = 0.250000000000 rational (3/10, 2/5): |ψ|² = 1/4 = Q0 = −α/β = 1/4
(double, double) windingPhase(int n, double x, double y, double cx, double cy)The phase winding n round a centre (cx, cy): e^{in\varphi}, \varphi = \operatorname{atan2}(y - cy, x - cx) (a ring's flux state, classic).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
import 'package:riptide_rational_gauge/classic.ray';
void main() {
// e^{inφ} round a centre: the classic ring flux state; its polygon winds n times (counted by signs here).
final re = <double>[], im = <double>[];
for (final (x, y) in [(3, 0), (3, 3), (0, 3), (-3, 3), (-3, 0), (-3, -3), (0, -3), (3, -3)]) {
final (r, i) = windingPhase(2, x.toDouble(), y.toDouble(), 0, 0);
re.add(r);
im.add(i);
}
print('n = 2 sampled at 8 points round the centre: winding by signs = ${windingOf(re, im)}');
}n = 2 sampled at 8 points round the centre: winding by signs = 2
Classes
CayleyArith
final class CayleyArith<T>
Exact helpers over any field T (\mathbb{Q} with riptide_precision's Rational).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// Exact U(1) phases over ℚ: points, products and powers stay exactly on the unit circle.
const c = CayleyArith<Rational>(ExactArith());
final (re, im) = c.point(Rational.fromInt(1, 2));
final pts = <List<Object>>[];
for (var n = 0; n <= 12; n++) {
final (pr, pi) = c.power(re, im, n);
pts.add([pr.toDouble(), pi.toDouble(), '$n']);
if (n == 12) print('e(1/2)^12 = ($pr, $pi), quadrance ${c.quadrance(pr, pi)}');
}
print('half-turn spread of e(1/2): ${c.halfTurnSpread(re)}');
}e(1/2)^12 = (32125393/244140625, -242017776/244140625), quadrance 1 half-turn spread of e(1/2): 1/5
Constructors
const CayleyArith(this.f)import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// CayleyArith(f) over exact rationals or doubles.
const q = CayleyArith<Rational>(ExactArith()), d = CayleyArith<double>(F64Arith());
print('exact e(2/3) = ${q.point(Rational.fromInt(2, 3))}');
print('float e(2/3) = ${d.point(2 / 3)}');
}exact e(2/3) = (5/13, 12/13) float e(2/3) = (0.38461538461538464, 0.923076923076923)
Properties
final KeplerArith<T> fMethods
(T, T) point(T t)e(t): (\frac{1 - t^{2}}{1 + t^{2}}, \frac{2t}{1 + t^{2}}).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// point(t): Pythagorean triples come out: t = 1/2 → (3/5, 4/5), t = 2/3 → (5/13, 12/13), t = 3/4 → (7/25, 24/25).
const c = CayleyArith<Rational>(ExactArith());
for (final (n, d) in [(1, 2), (2, 3), (3, 4), (1, 5)]) print('e($n/$d) = ${c.point(Rational.fromInt(n, d))}');
}e(1/2) = (3/5, 4/5) e(2/3) = (5/13, 12/13) e(3/4) = (7/25, 24/25) e(1/5) = (12/13, 5/13)
T quadrance(T re, T im)re^{2} + im^{2} (1 exactly for every Cayley point and every product of them).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// quadrance(re, im) = re² + im²: exactly 1 for every Cayley point.
const c = CayleyArith<Rational>(ExactArith());
final (a, b) = c.point(Rational.fromInt(7, 11));
print('e(7/11) = ($a, $b), quadrance = ${c.quadrance(a, b)}');
print('quadrance(3, 4) = ${c.quadrance(Rational.fromInt(3), Rational.fromInt(4))}');
}e(7/11) = (36/85, 77/85), quadrance = 1 quadrance(3, 4) = 25
(T, T) mul(T a, T b, T c, T d)(a + ib)(c + \operatorname{id}).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// mul(a, b, c, d) = (a + ib)(c + id): the product of two Cayley points is a Cayley point.
const c = CayleyArith<Rational>(ExactArith());
final (a, b) = c.point(Rational.fromInt(1, 2));
final (x, y) = c.point(Rational.fromInt(2, 3));
final (pr, pi) = c.mul(a, b, x, y);
print('e(1/2)·e(2/3) = ($pr, $pi), quadrance ${c.quadrance(pr, pi)}, = e(7/4): ${c.point(Rational.fromInt(7, 4))}');
}e(1/2)·e(2/3) = (-33/65, 56/65), quadrance 1, = e(7/4): (-33/65, 56/65)
(T, T) power(T re, T im, int n)The n-th power of a unit number by repeated multiplication (n \ge 0); exact.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// power(re, im, n) by repeated multiplication; exact for every n.
const c = CayleyArith<Rational>(ExactArith());
final (a, b) = c.point(Rational.fromInt(1, 3));
for (final n in [1, 2, 4, 8]) {
final (pr, pi) = c.power(a, b, n);
print('e(1/3)^$n = ($pr, $pi)');
}
}e(1/3)^1 = (4/5, 3/5) e(1/3)^2 = (7/25, 24/25) e(1/3)^4 = (-527/625, 336/625) e(1/3)^8 = (164833/390625, -354144/390625)
T halfTurnSpread(T re)The half-turn spread \frac{1 - re}{2} of a unit number.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// halfTurnSpread(re) = (1 − re)/2 = t²/(1 + t²), exact.
const c = CayleyArith<Rational>(ExactArith());
for (final (n, d) in [(0, 1), (1, 2), (1, 1), (3, 1)]) {
final t = Rational.fromInt(n, d);
print('t = $t: ${c.halfTurnSpread(c.point(t).$1)}');
}
}t = 0: 0 t = 1/2: 1/5 t = 1: 1/2 t = 3: 9/10
ExactGaugeLattice
final class ExactGaugeLattice<T>
The lattice model over T, stepped the rational way.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// The lattice over ℚ: Hamiltonian steps keep every |U|² = 1 and Gauss's law exactly.
// The same start in doubles (the rational way, held to rounding) for the same 2 steps.
const f = ExactArith(), c = CayleyArith<Rational>(ExactArith());
Rational r(int n, [int d = 1]) => Rational.fromInt(n, d);
final geo = LatticeGeometry(3, 3, periodicX: true, periodicY: true);
final ex = ExactGaugeLattice<Rational>(geo, f, alpha: r(-1, 2), beta: r(1), g2: r(1), sign: (x) => x.sign);
final fl = GaugeLattice(geo, alpha: -0.5, beta: 1, g2: 1);
final taus = [r(1, 3), r(-1, 2), r(2, 5), r(1, 7), r(-3, 4), r(1, 2)];
for (var i = 0; i < geo.sites; i++) {
ex.pr[i] = r(i % 3 - 1, 2 + i % 2);
ex.pi[i] = r((i * 5) % 7 - 3, 4);
fl.pr[i] = ex.pr[i].toDouble();
fl.pi[i] = ex.pi[i].toDouble();
ex.qr[i] = r(1, 4 + i); // a momentum π, so Gauss's law starts nonzero
fl.qr[i] = ex.qr[i].toDouble();
for (var mu = 0; mu < 2; mu++) {
final (re, im) = c.point(taus[(2 * i + mu) % taus.length]);
ex.ur[2 * i + mu] = re;
ex.ui[2 * i + mu] = im;
fl.ur[2 * i + mu] = re.toDouble();
fl.ui[2 * i + mu] = im.toDouble();
}
}
final g0 = [for (var i = 0; i < geo.sites; i++) ex.gauss(i)];
for (var k = 0; k < 2; k++) {
ex.evolve(r(1, 10));
fl.evolve(0.1);
}
print('exact, 2 steps: Gauss unchanged at every site: ${[for (var i = 0; i < geo.sites; i++) ex.gauss(i) == g0[i]].every((b) => b)}, every |U|² = 1: ${ex.linkQuadrances().every((q) => q == Rational.one)}');
var worst = 0.0;
for (var i = 0; i < geo.sites; i++) {
final d = (fl.gauss(i) - g0[i].toDouble()).abs();
if (d > worst) worst = d;
}
print('float, 2 steps: max |Gauss − start| = ${worst == 0 ? '0' : worst.toStringAsExponential(1)}, max ||U|² − 1| = ${fl.unitDrift().toStringAsExponential(1)}');
print('exact energy after 2 steps ≈ ${ex.energy().toDouble().toStringAsFixed(12)} (denominator ${ex.energy().denominator.bitLength} bits); float ${fl.energy().toStringAsFixed(12)}');
}exact, 2 steps: Gauss unchanged at every site: true, every |U|² = 1: true float, 2 steps: max |Gauss − start| = 1.7e-16, max ||U|² − 1| = 2.2e-16 exact energy after 2 steps ≈ 15.690112885332 (denominator 9502 bits); float 15.690112885332
Constructors
ExactGaugeLattice(this.geometry, this.f, {required this.alpha, required this.beta, required this.g2, required this.sign})import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// ExactGaugeLattice(geometry, f, alpha:, beta:, g2:, sign:): ψ = 0, U = 1, E = 0; sign is for the exact winding.
final l = ExactGaugeLattice<Rational>(LatticeGeometry(2, 2, periodicX: true, periodicY: true), const ExactArith(),
alpha: Rational.fromInt(-1), beta: Rational.one, g2: Rational.one, sign: (x) => x.sign);
print('${l.pr.length} sites, ${l.ur.length} links, F = ${l.energy()}');
}4 sites, 8 links, F = 0
Properties
final LatticeGeometry geometryfinal KeplerArith<T> ffinal List<T> prfinal List<T> pifinal List<T> qrfinal List<T> qifinal List<T> urfinal List<T> uifinal List<T> elT alphaT betaT g2T hrT hilate List<T> grlate List<T> gilate List<T> flMethods
void computeForces()import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// computeForces(): exact forces gr, gi (per site) and fl (per link).
Rational r(int n, [int d = 1]) => Rational.fromInt(n, d);
final l = ExactGaugeLattice<Rational>(LatticeGeometry(2, 1), const ExactArith(), alpha: r(-1), beta: r(1), g2: r(1), sign: (x) => x.sign);
l.pr[0] = r(1);
l.pr[1] = r(1, 2);
final (cr, ci) = const CayleyArith<Rational>(ExactArith()).point(r(1, 2));
l.ur[0] = cr;
l.ui[0] = ci;
l.computeForces();
print('∂F/∂ψ̄ = (${l.gr[0]}, ${l.gi[0]}), (${l.gr[1]}, ${l.gi[1]}); ∂F/∂θ on the link = ${l.fl[0]}');
}∂F/∂ψ̄ = (7/10, 2/5), (-19/40, -4/5); ∂F/∂θ on the link = 4/5
T energy()The free energy, exactly.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// energy(): the free energy as an exact rational; two exact relaxation steps lower it.
Rational r(int n, [int d = 1]) => Rational.fromInt(n, d);
final l = ExactGaugeLattice<Rational>(LatticeGeometry(2, 2, periodicX: true, periodicY: true), const ExactArith(),
alpha: r(-1, 2), beta: r(1), g2: r(1), sign: (x) => x.sign);
for (var i = 0; i < 4; i++) {
l.pr[i] = r(i + 1, 5);
l.pi[i] = r(1, 3);
}
final e0 = l.energy();
l.relax(r(1, 10));
final e1 = l.energy();
print('F = $e0 ≈ ${e0.toDouble().toStringAsFixed(9)}');
print('after one step F ≈ ${e1.toDouble().toStringAsFixed(9)} (exact, ${e1.denominator.bitLength}-bit denominator), lower: ${e1 < e0}');
}F = 21212/50625 ≈ 0.419002469 after one step F ≈ -0.213771971 (exact, 91-bit denominator), lower: true
void relax(T dt)One time-dependent Ginzburg–Landau step (as GaugeLattice.relax, rational way).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// relax(dt): an exact gradient-flow step; links turn by Cayley points, so |U|² stays exactly 1.
Rational r(int n, [int d = 1]) => Rational.fromInt(n, d);
final l = ExactGaugeLattice<Rational>(LatticeGeometry(3, 2), const ExactArith(), alpha: r(-1), beta: r(1), g2: r(1), sign: (x) => x.sign);
for (var i = 0; i < 6; i++) {
l.pr[i] = r(1, 2);
l.pi[i] = r(i - 2, 4);
}
for (var k = 0; k < 2; k++) l.relax(r(1, 5));
print('after 2 steps every |U|² = 1: ${l.linkQuadrances().every((q) => q == Rational.one)}');
print('U of link 0 = (${l.ur[0].toDouble().toStringAsFixed(9)}, ${l.ui[0].toDouble().toStringAsFixed(9)}), denominators ${l.ur[0].denominator.bitLength} bits');
}after 2 steps every |U|² = 1: true U of link 0 = (0.995698037, 0.092657534), denominators 62 bits
void evolve(T dt)One Hamiltonian step (as GaugeLattice.evolve, rational way, no friction).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// evolve(dt): an exact symplectic Euler step; Gauss's law at every site is unchanged, exactly.
Rational r(int n, [int d = 1]) => Rational.fromInt(n, d);
final l = ExactGaugeLattice<Rational>(LatticeGeometry(2, 2, periodicX: true, periodicY: true), const ExactArith(),
alpha: r(-1, 2), beta: r(2), g2: r(1), sign: (x) => x.sign);
for (var i = 0; i < 4; i++) {
l.pr[i] = r(3, 10);
l.pi[i] = r(i, 5);
l.qi[i] = r(1, 3 + i); // a momentum π, so Gauss's law starts nonzero
}
final g0 = [for (var i = 0; i < 4; i++) l.gauss(i)];
for (var k = 0; k < 3; k++) l.evolve(r(1, 4));
print('Gauss before ${g0.join(', ')}; after 3 steps ${[for (var i = 0; i < 4; i++) l.gauss(i)].join(', ')}');
}Gauss before -1/5, -3/20, -3/25, -1/10; after 3 steps -1/5, -3/20, -3/25, -1/10
T gauss(int i)Gauss's law at i: \sum_{\mathrm{out}} E - \sum_{in} E + 2 \operatorname{Im}(\bar{\pi}\psi).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// gauss(i): Σ_out E − Σ_in E + 2 Im(π̄ψ), exact.
final l = ExactGaugeLattice<Rational>(LatticeGeometry(3, 1, periodicX: true, periodicY: true), const ExactArith(),
alpha: Rational.fromInt(-1), beta: Rational.one, g2: Rational.one, sign: (x) => x.sign);
l.el[0] = Rational.fromInt(1, 3);
l.pr[2] = Rational.one;
l.qi[2] = Rational.fromInt(1, 2);
print([for (var i = 0; i < 3; i++) l.gauss(i)].join(', '));
}1/3, -1/3, -1
Iterable<T> linkQuadrances()Every link's quadrance |U|^{2}, which stays exactly 1.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// linkQuadrances(): |U|² of every existing link, exactly 1 after any number of exact steps.
Rational r(int n, [int d = 1]) => Rational.fromInt(n, d);
final l = ExactGaugeLattice<Rational>(LatticeGeometry(2, 2), const ExactArith(), alpha: r(-1), beta: r(1), g2: r(1), sign: (x) => x.sign);
for (var i = 0; i < 4; i++) l.pr[i] = r(i, 3);
l.relax(r(1, 3));
print(l.linkQuadrances().join(', '));
}1, 1, 1, 1
void applyGauge(List<T> gRe, List<T> gIm)\psi \to g\psi, \pi \to g\pi, U_{l} \to g_{j} U_{l} \bar{g}_{i}, exactly.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// applyGauge: a rational gauge turn at every site leaves the exact energy exactly equal.
const c = CayleyArith<Rational>(ExactArith());
Rational r(int n, [int d = 1]) => Rational.fromInt(n, d);
final geo = LatticeGeometry(3, 3, periodicX: true, periodicY: true);
final l = ExactGaugeLattice<Rational>(geo, const ExactArith(), alpha: r(-1, 2), beta: r(1), g2: r(1), sign: (x) => x.sign);
for (var i = 0; i < geo.sites; i++) {
l.pr[i] = r(i % 3, 4);
l.pi[i] = r(1, 1 + i);
final (a, b) = c.point(r(i, 5));
l.ur[2 * i] = a;
l.ui[2 * i] = b;
}
final e0 = l.energy();
final g = [for (var i = 0; i < geo.sites; i++) c.point(r(i - 4, 3 + i))];
l.applyGauge([for (final t in g) t.$1], [for (final t in g) t.$2]);
print('F ≈ ${e0.toDouble().toStringAsFixed(12)} (exact, ${e0.denominator.bitLength}-bit denominator)');
print('after the gauge transformation: equal exactly: ${l.energy() == e0}');
}F ≈ 7.973005846745 (exact, 82-bit denominator) after the gauge transformation: equal exactly: true
int vortexAt(int i)The vortex number of the plaquette at i, by exact signs.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// vortexAt(i): exact vortex number by signs of exact rationals.
Rational r(int n, [int d = 1]) => Rational.fromInt(n, d);
final geo = LatticeGeometry(4, 4);
final l = ExactGaugeLattice<Rational>(geo, const ExactArith(), alpha: r(-1), beta: r(1), g2: r(1), sign: (x) => x.sign);
for (var i = 0; i < geo.sites; i++) {
l.pr[i] = r(2 * geo.xOf(i) - 3, 2);
l.pi[i] = r(2 * geo.yOf(i) - 3, 2);
}
print([for (var i = 0; i < geo.sites; i++) if (l.vortexAt(i) != 0) 'plaquette (${geo.xOf(i)}, ${geo.yOf(i)}): ${l.vortexAt(i)}'].join(', '));
}plaquette (1, 1): 1
Ramp
final class Ramp
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// A value ramping linearly from `from` to `to` over `length` steps after `start`: the labs' temperature and field knobs.
const r = Ramp(-0.25, 0.25, 10, 20);
print([for (final s in [0, 10, 15, 20, 30, 40]) 'at($s) = ${r.at(s)}'].join(', '));
print('settled at 25: ${r.settledAt(25)}, at 30: ${r.settledAt(30)}');
}at(0) = -0.25, at(10) = -0.25, at(15) = -0.125, at(20) = 0.0, at(30) = 0.25, at(40) = 0.25 settled at 25: false, at 30: true
Constructors
const Ramp(this.from, [double? to, this.start = 0, this.length = 0])import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// Ramp(from, [to, start, length]): with only `from` it is a constant.
const c = Ramp(0.015), r = Ramp(0, 0.055, 0, 1500);
print('constant: ${c.at(0)}, ${c.at(999)}; rising field at 750: ${r.at(750)}');
}constant: 0.015, 0.015; rising field at 750: 0.0275
Properties
final double fromfinal double tofinal int startfinal int lengthMethods
double at(int step)import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// at(step): the value at a step.
const r = Ramp(1, 0, 5, 4);
print([for (var s = 4; s <= 10; s++) '${r.at(s)}'].join(', '));
}1.0, 1.0, 0.75, 0.5, 0.25, 0.0, 0.0
bool settledAt(int step)import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// settledAt(step): whether the ramp has finished.
const r = Ramp(0, 1, 100, 50);
print([for (final s in [0, 120, 149, 150]) 'settledAt($s) = ${r.settledAt(s)}'].join(', '));
}settledAt(0) = false, settledAt(120) = false, settledAt(149) = false, settledAt(150) = true
enum SuperconductorType
Type I (\kappa^{2} < \frac{1}{2}: the whole field is expelled) or type II (\kappa^{2} > \frac{1}{2}: it enters as vortices).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// The materials of the lab: κ² = β/(2g²) decides type I (< 1/2) or type II (> 1/2); ψ₀² = depth/β exactly.
for (final t in SuperconductorType.values) {
final p = GLParameters(alpha: -t.depth, beta: t.beta, g2: t.g2);
print('${t.name}: β = ${t.beta}, g² = ${t.g2}, κ² = ${p.kappa2}, ${p.typeII ? 'type II' : 'type I'}, ξ² = ${p.xi2}, λ² = ${p.lambda2}, ψ0² = ${t.psi0 * t.psi0} = Q0 = ${p.q0}');
}
}typeI: β = 1.0, g² = 2.0, κ² = 0.25, type I, ξ² = 36.0, λ² = 9.0, ψ0² = 0.027777777777777776 = Q0 = 0.027777777777777776 meissner: β = 1.0, g² = 0.5, κ² = 1.0, type II, ξ² = 9.0, λ² = 9.0, ψ0² = 0.1111111111111111 = Q0 = 0.1111111111111111 ring: β = 1.0, g² = 0.5, κ² = 1.0, type II, ξ² = 4.0, λ² = 4.0, ψ0² = 0.25 = Q0 = 0.25 thinRing: β = 1.0, g² = 0.02, κ² = 25.0, type II, ξ² = 16.0, λ² = 400.0, ψ0² = 0.0625 = Q0 = 0.0625 bulk: β = 4.0, g² = 0.125, κ² = 16.0, type II, ξ² = 4.0, λ² = 64.0, ψ0² = 0.0625 = Q0 = 0.0625 typeII: β = 4.0, g² = 0.5, κ² = 4.0, type II, ξ² = 4.0, λ² = 16.0, ψ0² = 0.0625 = Q0 = 0.0625
Values
typeI(beta: 1, g2: 2, depth: 1 / 36, psi0: 1 / 6)\kappa^{2} = \frac{\beta}{2g^{2}} = \frac{1}{4}: \xi = 6, \lambda = 3 sites (\xi^{2} = \frac{1}{|\alpha|} = 36, \lambda^{2} = \frac{1}{2g^{2}Q_{0}} = 9), \psi_{0} = \frac{1}{6}.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorType.typeI: its parameters and what they make.
const t = SuperconductorType.typeI;
final p = GLParameters(alpha: -t.depth, beta: t.beta, g2: t.g2);
print('β = ${t.beta}, g² = ${t.g2}, depth |α| = ${t.depth}, ψ0 = ${t.psi0}');
print('ξ² = ${p.xi2}, λ² = ${p.lambda2}, κ² = ${p.kappa2} (${p.typeII ? 'type II' : 'type I'})');
}β = 1.0, g² = 2.0, depth |α| = 0.027777777777777776, ψ0 = 0.16666666666666666 ξ² = 36.0, λ² = 9.0, κ² = 0.25 (type I)
meissner(beta: 1, g2: 0.5, depth: 1 / 9, psi0: 1 / 3)\kappa^{2} = 1 (just type II): \xi = \lambda = 3 sites, \psi_{0} = \frac{1}{3}. Below H_{c1} a vortex is pushed out by the surface: the Meissner disc.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorType.meissner: its parameters and what they make.
const t = SuperconductorType.meissner;
final p = GLParameters(alpha: -t.depth, beta: t.beta, g2: t.g2);
print('β = ${t.beta}, g² = ${t.g2}, depth |α| = ${t.depth}, ψ0 = ${t.psi0}');
print('ξ² = ${p.xi2}, λ² = ${p.lambda2}, κ² = ${p.kappa2} (${p.typeII ? 'type II' : 'type I'})');
}β = 1.0, g² = 0.5, depth |α| = 0.1111111111111111, ψ0 = 0.3333333333333333 ξ² = 9.0, λ² = 9.0, κ² = 1.0 (type II)
ring(beta: 1, g2: 0.5, depth: 0.25, psi0: 0.5)\kappa^{2} = 1: \xi = \lambda = 2 sites, \psi_{0} = \frac{1}{2}: a ring several \lambda thick, so the flux it holds is close to whole quanta.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorType.ring: its parameters and what they make.
const t = SuperconductorType.ring;
final p = GLParameters(alpha: -t.depth, beta: t.beta, g2: t.g2);
print('β = ${t.beta}, g² = ${t.g2}, depth |α| = ${t.depth}, ψ0 = ${t.psi0}');
print('ξ² = ${p.xi2}, λ² = ${p.lambda2}, κ² = ${p.kappa2} (${p.typeII ? 'type II' : 'type I'})');
}β = 1.0, g² = 0.5, depth |α| = 0.25, ψ0 = 0.5 ξ² = 4.0, λ² = 4.0, κ² = 1.0 (type II)
thinRing(beta: 1, g2: 0.02, depth: 1 / 16, psi0: 0.25)A thin ring (three sites across, under \xi): \xi = 4, \lambda = 20 sites (\kappa^{2} = 25), \psi_{0} = \frac{1}{4}. The field goes straight through (\lambda is far wider than the ring), the current grows with it until the condensate gives way at one point and the phase slips: the fluxoid changes by one.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorType.thinRing: its parameters and what they make.
const t = SuperconductorType.thinRing;
final p = GLParameters(alpha: -t.depth, beta: t.beta, g2: t.g2);
print('β = ${t.beta}, g² = ${t.g2}, depth |α| = ${t.depth}, ψ0 = ${t.psi0}');
print('ξ² = ${p.xi2}, λ² = ${p.lambda2}, κ² = ${p.kappa2} (${p.typeII ? 'type II' : 'type I'})');
}β = 1.0, g² = 0.02, depth |α| = 0.0625, ψ0 = 0.25 ξ² = 16.0, λ² = 400.0, κ² = 25.0 (type II)
bulk(beta: 4, g2: 0.125, depth: 0.25, psi0: 0.25)\kappa^{2} = 16: \xi = 2, \lambda = 8 sites, \psi_{0} = \frac{1}{4}: vortices 10 apart feel each other strongly and order.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorType.bulk: its parameters and what they make.
const t = SuperconductorType.bulk;
final p = GLParameters(alpha: -t.depth, beta: t.beta, g2: t.g2);
print('β = ${t.beta}, g² = ${t.g2}, depth |α| = ${t.depth}, ψ0 = ${t.psi0}');
print('ξ² = ${p.xi2}, λ² = ${p.lambda2}, κ² = ${p.kappa2} (${p.typeII ? 'type II' : 'type I'})');
}β = 4.0, g² = 0.125, depth |α| = 0.25, ψ0 = 0.25 ξ² = 4.0, λ² = 64.0, κ² = 16.0 (type II)
typeII(beta: 4, g2: 0.5, depth: 0.25, psi0: 0.25)\kappa^{2} = 4: \xi = 2, \lambda = 4 sites, \psi_{0} = \frac{1}{4}.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorType.typeII: its parameters and what they make.
const t = SuperconductorType.typeII;
final p = GLParameters(alpha: -t.depth, beta: t.beta, g2: t.g2);
print('β = ${t.beta}, g² = ${t.g2}, depth |α| = ${t.depth}, ψ0 = ${t.psi0}');
print('ξ² = ${p.xi2}, λ² = ${p.lambda2}, κ² = ${p.kappa2} (${p.typeII ? 'type II' : 'type I'})');
}β = 4.0, g² = 0.5, depth |α| = 0.25, ψ0 = 0.25 ξ² = 4.0, λ² = 16.0, κ² = 4.0 (type II)
Constructors
const SuperconductorType({required this.beta, required this.g2, required this.depth, required this.psi0})import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// const SuperconductorType({beta, g2, depth, psi0}): enum values only; read them through the values.
print([for (final t in SuperconductorType.values) '${t.name} (β ${t.beta}, g² ${t.g2})'].join(', '));
}typeI (β 1.0, g² 2.0), meissner (β 1.0, g² 0.5), ring (β 1.0, g² 0.5), thinRing (β 1.0, g² 0.02), bulk (β 4.0, g² 0.125), typeII (β 4.0, g² 0.5)
Properties
final double betafinal double g2final double psi0A rational point on the rim: \psi_{0}^{2} = Q_{0} = depth/\beta exactly (no root).
enum SuperconductorPreset
The superconductor experiments: their shapes and presets.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// The twelve presets, their material and shape.
for (final p in SuperconductorPreset.values) {
final e = SuperconductorExperiment(preset: p, size: 16);
print('${p.name}: ${SuperconductorExperiment.typeFor(p).name}, ${e.shape.name}');
}
}coolInField: meissner, disc fieldAfterCooling: meissner, disc warmUp: meissner, disc fieldEnters: typeII, square fieldCooled: typeII, square strongField: typeII, square typeIForComparison: typeI, square triangularLattice: bulk, torus trapFlux: ring, ring screenField: ring, ring fluxJumps: thinRing, thinRing windThree: ring, ring
Values
coolInFieldCool a type-I disc through T_{c} in a field: the field is pushed out to a skin of depth \lambda.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorPreset.coolInField: A cold front grows from the middle of a disc in a field, pushing the field out.
final e = SuperconductorExperiment(preset: SuperconductorPreset.coolInField, size: 24);
final s0 = e.lattice.energy();
e.advance(100);
print('material ${e.type.name}, shape ${e.shape.name}, field parameter now ${e.field.toStringAsFixed(6)}, cold: ${e.cold}');
print('F: start ${s0.toStringAsFixed(6)}, after 100 steps ${e.lattice.energy().toStringAsFixed(6)}; vortices now ${e.vortices().length}');
print('field inside the disc / applied: ${e.insideFieldShare().toStringAsFixed(4)}');
}material meissner, shape disc, field parameter now 0.015000, cold: true F: start 0.122039, after 100 steps -0.305748; vortices now 0 field inside the disc / applied: 0.9394
fieldAfterCoolingCool first, then switch the field on: it never gets in.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorPreset.fieldAfterCooling: Cool first, then switch the field on: it stays out of the disc.
final e = SuperconductorExperiment(preset: SuperconductorPreset.fieldAfterCooling, size: 24);
final s0 = e.lattice.energy();
e.advance(100);
print('material ${e.type.name}, shape ${e.shape.name}, field parameter now ${e.field.toStringAsFixed(6)}, cold: ${e.cold}');
print('F: start ${s0.toStringAsFixed(6)}, after 100 steps ${e.lattice.energy().toStringAsFixed(6)}; vortices now ${e.vortices().length}');
print('field inside the disc / applied: ${e.insideFieldShare().toStringAsFixed(4)}');
}material meissner, shape disc, field parameter now 0.003000, cold: true F: start -1.283951, after 100 steps -1.273180; vortices now 0 field inside the disc / applied: 0.0056
warmUpWarm the cooled disc above T_{c}: the field floods back in.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorPreset.warmUp: A cooled disc in a field, warmed above T_c from step 150.
final e = SuperconductorExperiment(preset: SuperconductorPreset.warmUp, size: 24);
final s0 = e.lattice.energy();
e.advance(100);
print('material ${e.type.name}, shape ${e.shape.name}, field parameter now ${e.field.toStringAsFixed(6)}, cold: ${e.cold}');
print('F: start ${s0.toStringAsFixed(6)}, after 100 steps ${e.lattice.energy().toStringAsFixed(6)}; vortices now ${e.vortices().length}');
print('field inside the disc / applied: ${e.insideFieldShare().toStringAsFixed(4)}');
}material meissner, shape disc, field parameter now 0.015000, cold: false F: start -0.807958, after 100 steps -1.176652; vortices now 0 field inside the disc / applied: 0.2963
fieldEntersA type-II square in a rising field: flux enters as vortices from the edges and settles into a lattice.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorPreset.fieldEnters: A type-II square in a slowly rising field.
final e = SuperconductorExperiment(preset: SuperconductorPreset.fieldEnters, size: 24);
final s0 = e.lattice.energy();
e.advance(100);
print('material ${e.type.name}, shape ${e.shape.name}, field parameter now ${e.field.toStringAsFixed(6)}, cold: ${e.cold}');
print('F: start ${s0.toStringAsFixed(6)}, after 100 steps ${e.lattice.energy().toStringAsFixed(6)}; vortices now ${e.vortices().length}');
print('flux in the sample: ${e.fluxQuantaInSample().toStringAsFixed(4)} quanta');
}material typeII, shape square, field parameter now 0.003667, cold: true F: start -3.125000, after 100 steps -3.112700; vortices now 0 flux in the sample: 0.1053 quanta
fieldCooledCooled in the field: vortices and antivortices everywhere, annihilating, then ordering.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorPreset.fieldCooled: A type-II square cooled in a field from noise.
final e = SuperconductorExperiment(preset: SuperconductorPreset.fieldCooled, size: 24);
final s0 = e.lattice.energy();
e.advance(100);
print('material ${e.type.name}, shape ${e.shape.name}, field parameter now ${e.field.toStringAsFixed(6)}, cold: ${e.cold}');
print('F: start ${s0.toStringAsFixed(6)}, after 100 steps ${e.lattice.energy().toStringAsFixed(6)}; vortices now ${e.vortices().length}');
print('flux in the sample: ${e.fluxQuantaInSample().toStringAsFixed(4)} quanta');
}material typeII, shape square, field parameter now 0.050000, cold: true F: start 2.878984, after 100 steps -0.016644; vortices now 4 flux in the sample: 5.7400 quanta
strongFieldA strong field: a dense vortex lattice.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorPreset.strongField: A type-II square in a strong rising field.
final e = SuperconductorExperiment(preset: SuperconductorPreset.strongField, size: 24);
final s0 = e.lattice.energy();
e.advance(100);
print('material ${e.type.name}, shape ${e.shape.name}, field parameter now ${e.field.toStringAsFixed(6)}, cold: ${e.cold}');
print('F: start ${s0.toStringAsFixed(6)}, after 100 steps ${e.lattice.energy().toStringAsFixed(6)}; vortices now ${e.vortices().length}');
print('flux in the sample: ${e.fluxQuantaInSample().toStringAsFixed(4)} quanta');
}material typeII, shape square, field parameter now 0.008333, cold: true F: start -3.125000, after 100 steps -3.061470; vortices now 0 flux in the sample: 0.2393 quanta
typeIForComparisonThe same field on a type-I square: no vortex lattice.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorPreset.typeIForComparison: The fieldEnters ramp on a type-I square.
final e = SuperconductorExperiment(preset: SuperconductorPreset.typeIForComparison, size: 24);
final s0 = e.lattice.energy();
e.advance(100);
print('material ${e.type.name}, shape ${e.shape.name}, field parameter now ${e.field.toStringAsFixed(6)}, cold: ${e.cold}');
print('F: start ${s0.toStringAsFixed(6)}, after 100 steps ${e.lattice.energy().toStringAsFixed(6)}; vortices now ${e.vortices().length}');
print('flux in the sample: ${e.fluxQuantaInSample().toStringAsFixed(4)} quanta');
}material typeI, shape square, field parameter now 0.003667, cold: true F: start -0.154321, after 100 steps -0.149518; vortices now 0 flux in the sample: 0.0260 quanta
triangularLatticeA piece of the bulk, wrapped so it has no edges (a torus \sqrt{3} times taller than wide), holding exactly 32 flux quanta: cooled from noise, the vortices settle into Abrikosov's triangular lattice (six neighbours each).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorPreset.triangularLattice: A periodic 40 × 69 tile holding exactly 32 flux quanta, cooled from noise.
final e = SuperconductorExperiment(preset: SuperconductorPreset.triangularLattice, size: 24);
final s0 = e.lattice.energy();
e.advance(100);
print('material ${e.type.name}, shape ${e.shape.name}, field parameter now ${e.field.toStringAsFixed(6)}, cold: ${e.cold}');
print('F: start ${s0.toStringAsFixed(6)}, after 100 steps ${e.lattice.energy().toStringAsFixed(6)}; vortices now ${e.vortices().length}');
print('flux in the sample: ${e.fluxQuantaInSample().toStringAsFixed(4)} quanta');
}material bulk, shape torus, field parameter now 0.036440, cold: true F: start 3.121255, after 100 steps 0.000000; vortices now 32 flux in the sample: 32.0000 quanta
trapFluxCool a ring in a field, then switch the field off: whole flux quanta stay trapped, held by a persistent current.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorPreset.trapFlux: A ring cooled in a field, the field then switched off.
final e = SuperconductorExperiment(preset: SuperconductorPreset.trapFlux, size: 24);
final s0 = e.lattice.energy();
e.advance(100);
print('material ${e.type.name}, shape ${e.shape.name}, field parameter now ${e.field.toStringAsFixed(6)}, cold: ${e.cold}');
print('F: start ${s0.toStringAsFixed(6)}, after 100 steps ${e.lattice.energy().toStringAsFixed(6)}; vortices now ${e.vortices().length}');
print('fluxoid round the ring: ${e.ringWinding()}, flux through the loop ${e.ringFluxQuanta().toStringAsFixed(4)} quanta');
}material ring, shape ring, field parameter now 0.011364, cold: true F: start 1216.680930, after 100 steps -5.571958; vortices now 0 fluxoid round the ring: 4, flux through the loop 3.0181 quanta
screenFieldSwitch a field on round a cold ring: the hole stays at zero flux (the fluxoid can't change without a vortex).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorPreset.screenField: A field switched on round a cold ring.
final e = SuperconductorExperiment(preset: SuperconductorPreset.screenField, size: 24);
final s0 = e.lattice.energy();
e.advance(100);
print('material ${e.type.name}, shape ${e.shape.name}, field parameter now ${e.field.toStringAsFixed(6)}, cold: ${e.cold}');
print('F: start ${s0.toStringAsFixed(6)}, after 100 steps ${e.lattice.energy().toStringAsFixed(6)}; vortices now ${e.vortices().length}');
print('fluxoid round the ring: ${e.ringWinding()}, flux through the loop ${e.ringFluxQuanta().toStringAsFixed(4)} quanta');
}material ring, shape ring, field parameter now 0.000000, cold: true F: start -11.000000, after 100 steps -11.000000; vortices now 0 fluxoid round the ring: 0, flux through the loop 0.0000 quanta
fluxJumpsA thin ring in a slowly rising field: the fluxoid steps up one quantum at a time (phase slips), a sawtooth of current.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorPreset.fluxJumps: A thin ring with a weak link in a slowly rising field.
final e = SuperconductorExperiment(preset: SuperconductorPreset.fluxJumps, size: 24);
final s0 = e.lattice.energy();
e.advance(100);
print('material ${e.type.name}, shape ${e.shape.name}, field parameter now ${e.field.toStringAsFixed(6)}, cold: ${e.cold}');
print('F: start ${s0.toStringAsFixed(6)}, after 100 steps ${e.lattice.energy().toStringAsFixed(6)}; vortices now ${e.vortices().length}');
print('fluxoid round the ring: ${e.ringWinding()}, flux through the loop ${e.ringFluxQuanta().toStringAsFixed(4)} quanta');
}material thinRing, shape thinRing, field parameter now 0.000167, cold: true F: start -0.005469, after 100 steps -0.020940; vortices now 0 fluxoid round the ring: 0, flux through the loop 0.0003 quanta
windThreeStart the ring's phase winding three times round (rational points that go round three times), no field.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorPreset.windThree: A ring whose phase starts wound three times round, no field.
final e = SuperconductorExperiment(preset: SuperconductorPreset.windThree, size: 24);
final s0 = e.lattice.energy();
e.advance(100);
print('material ${e.type.name}, shape ${e.shape.name}, field parameter now ${e.field.toStringAsFixed(6)}, cold: ${e.cold}');
print('F: start ${s0.toStringAsFixed(6)}, after 100 steps ${e.lattice.energy().toStringAsFixed(6)}; vortices now ${e.vortices().length}');
print('fluxoid round the ring: ${e.ringWinding()}, flux through the loop ${e.ringFluxQuanta().toStringAsFixed(4)} quanta');
}material ring, shape ring, field parameter now 0.000000, cold: true F: start 264.494073, after 100 steps -7.214624; vortices now 0 fluxoid round the ring: 3, flux through the loop 2.3866 quanta
enum SuperconductorShape
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// The sample shapes: which sites are superconducting.
for (final s in SuperconductorShape.values) print(s.name);
final e = SuperconductorExperiment(preset: SuperconductorPreset.trapFlux, size: 20);
final g = e.lattice.geometry;
print('ring of size 20: ${[for (var i = 0; i < g.sites; i++) g.sc[i]].where((x) => x == 1).length} superconducting sites of ${g.sites}');
}disc square torus ring thinRing ring of size 20: 244 superconducting sites of 400
Values
discimport 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorShape.disc (used by coolInField).
final e = SuperconductorExperiment(preset: SuperconductorPreset.coolInField, size: 20);
final g = e.lattice.geometry;
print('shape ${e.shape.name}: ${g.nx} × ${g.ny} sites, periodic: ${g.periodicX}, superconducting: ${[for (var i = 0; i < g.sites; i++) g.sc[i]].where((x) => x == 1).length}');
}shape disc: 20 × 20 sites, periodic: false, superconducting: 148
squareimport 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorShape.square (used by fieldEnters).
final e = SuperconductorExperiment(preset: SuperconductorPreset.fieldEnters, size: 20);
final g = e.lattice.geometry;
print('shape ${e.shape.name}: ${g.nx} × ${g.ny} sites, periodic: ${g.periodicX}, superconducting: ${[for (var i = 0; i < g.sites; i++) g.sc[i]].where((x) => x == 1).length}');
}shape square: 20 × 20 sites, periodic: false, superconducting: 256
torusimport 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorShape.torus (used by triangularLattice).
final e = SuperconductorExperiment(preset: SuperconductorPreset.triangularLattice, size: 20);
final g = e.lattice.geometry;
print('shape ${e.shape.name}: ${g.nx} × ${g.ny} sites, periodic: ${g.periodicX}, superconducting: ${[for (var i = 0; i < g.sites; i++) g.sc[i]].where((x) => x == 1).length}');
}shape torus: 40 × 69 sites, periodic: true, superconducting: 2760
ringimport 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorShape.ring (used by trapFlux).
final e = SuperconductorExperiment(preset: SuperconductorPreset.trapFlux, size: 20);
final g = e.lattice.geometry;
print('shape ${e.shape.name}: ${g.nx} × ${g.ny} sites, periodic: ${g.periodicX}, superconducting: ${[for (var i = 0; i < g.sites; i++) g.sc[i]].where((x) => x == 1).length}');
}shape ring: 20 × 20 sites, periodic: false, superconducting: 244
thinRingimport 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorShape.thinRing (used by fluxJumps).
final e = SuperconductorExperiment(preset: SuperconductorPreset.fluxJumps, size: 20);
final g = e.lattice.geometry;
print('shape ${e.shape.name}: ${g.nx} × ${g.ny} sites, periodic: ${g.periodicX}, superconducting: ${[for (var i = 0; i < g.sites; i++) g.sc[i]].where((x) => x == 1).length}');
}shape thinRing: 20 × 20 sites, periodic: false, superconducting: 20
extension on SuperconductorPreset
extension on SuperconductorPreset
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// The extension on SuperconductorPreset gives each preset its shape (read here through SuperconductorExperiment.shape).
for (final p in SuperconductorPreset.values) print('${p.name} → ${SuperconductorExperiment(preset: p, size: 12).shape.name}');
}coolInField → disc fieldAfterCooling → disc warmUp → disc fieldEnters → square fieldCooled → square strongField → square typeIForComparison → square triangularLattice → torus trapFlux → ring screenField → ring fluxJumps → thinRing windThree → ring
Properties
SuperconductorShape get shapefinal class SuperconductorExperiment
A superconducting sample on the lattice, relaxed by time-dependent Ginzburg–Landau.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// A ring whose condensate starts wound three times round, relaxed both ways (rational links and classic angles),
// 400 steps each. The fluxoid is counted exactly by signs on the rational side, by atan2 on the classic side.
final a = SuperconductorExperiment(preset: SuperconductorPreset.windThree, size: 28);
final b = a.twin(LinkMaths.classic);
final ea = <List<double>>[], eb = <List<double>>[];
for (var k = 0; k <= 400; k += 20) {
ea.add([k.toDouble(), a.lattice.energy()]);
eb.add([k.toDouble(), b.lattice.energy()]);
if (k < 400) {
a.advance(20);
b.advance(20);
}
}
print('rational: fluxoid ${a.ringWinding()}, flux through the loop ${a.ringFluxQuanta().toStringAsFixed(6)} quanta, F = ${a.lattice.energy().toStringAsFixed(8)}');
print('classic: fluxoid ${b.ringWinding()}, flux through the loop ${b.ringFluxQuanta().toStringAsFixed(6)} quanta, F = ${b.lattice.energy().toStringAsFixed(8)}');
}rational: fluxoid 3, flux through the loop 2.697251 quanta, F = -11.95777735 classic: fluxoid 3, flux through the loop 2.697251 quanta, F = -11.95777735
Constructors
SuperconductorExperiment({SuperconductorPreset preset = SuperconductorPreset.coolInField, LinkMaths maths = LinkMaths.rational, this.size = 64})import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorExperiment({preset, maths, size}): builds the sample and its initial state.
final e = SuperconductorExperiment(preset: SuperconductorPreset.fieldAfterCooling, size: 20);
print('preset ${e.preset.name}, maths ${e.maths.name}, ${e.size} × ${e.size}, material ${e.type.name}, t = ${e.t}');
print('dt = ${e.dt}, dtA = ${e.dtA}, depth = ${e.depth}');
}preset fieldAfterCooling, maths rational, 20 × 20, material meissner, t = 0 dt = 0.1, dtA = 0.1, depth = 0.1111111111111111
Static
static SuperconductorType typeFor(SuperconductorPreset p)The material a preset starts with.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// typeFor(preset): the material each preset starts with.
for (final p in SuperconductorPreset.values) print('${p.name} → ${SuperconductorExperiment.typeFor(p).name}');
}coolInField → meissner fieldAfterCooling → meissner warmUp → meissner fieldEnters → typeII fieldCooled → typeII strongField → typeII typeIForComparison → typeI triangularLattice → bulk trapFlux → ring screenField → ring fluxJumps → thinRing windThree → ring
static const int frontSteps = 1800Steps for the front to cross the disc.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorExperiment.frontSteps: steps for the cooling front to cross the disc in coolInField.
print('frontSteps = ${SuperconductorExperiment.frontSteps}');
print('front radius ramp of a 24-site disc: ${SuperconductorExperiment(size: 24).frontRamp!.length} steps');
}frontSteps = 1800 front radius ramp of a 24-site disc: 1800 steps
static const int torusNx = 40The bulk tile: 40 \times 69 sites (\frac{69}{40} \approx \sqrt{3}, so a triangular lattice of spacing 10 fits: 4 \times 4 cells of 2 vortices), and the field per plaquette whose 2,760 plaquettes hold exactly torusQuanta quanta. Its Cayley parameter is the fraction \frac{6829}{187402} \approx \tan(\pi \cdot \frac{32}{2760}); the 5 \times 10^{-11} by which it misses collects in one plaquette (the torus forces the total to a whole number of quanta exactly).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorExperiment.torusNx: the periodic tile's width (69/40 is close to √3, so a triangular vortex lattice fits).
print('torusNx = ${SuperconductorExperiment.torusNx}');
print('69/40 = ${69 / 40}');
}torusNx = 40 69/40 = 1.725
static const int torusNy = 69The bulk tile: 40 \times 69 sites (\frac{69}{40} \approx \sqrt{3}, so a triangular lattice of spacing 10 fits: 4 \times 4 cells of 2 vortices), and the field per plaquette whose 2,760 plaquettes hold exactly torusQuanta quanta. Its Cayley parameter is the fraction \frac{6829}{187402} \approx \tan(\pi \cdot \frac{32}{2760}); the 5 \times 10^{-11} by which it misses collects in one plaquette (the torus forces the total to a whole number of quanta exactly).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorExperiment.torusNy: the periodic tile's height.
print('torusNy = ${SuperconductorExperiment.torusNy}');
print('tile: ${SuperconductorExperiment.torusNx} × ${SuperconductorExperiment.torusNy} = ${SuperconductorExperiment.torusNx * SuperconductorExperiment.torusNy} plaquettes');
}torusNy = 69 tile: 40 × 69 = 2760 plaquettes
static const int torusQuanta = 32The bulk tile: 40 \times 69 sites (\frac{69}{40} \approx \sqrt{3}, so a triangular lattice of spacing 10 fits: 4 \times 4 cells of 2 vortices), and the field per plaquette whose 2,760 plaquettes hold exactly torusQuanta quanta. Its Cayley parameter is the fraction \frac{6829}{187402} \approx \tan(\pi \cdot \frac{32}{2760}); the 5 \times 10^{-11} by which it misses collects in one plaquette (the torus forces the total to a whole number of quanta exactly).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorExperiment.torusQuanta: the whole flux quanta the tile holds.
print('torusQuanta = ${SuperconductorExperiment.torusQuanta}');
print('flux per plaquette ≈ 32/2760 = ${(32 / 2760).toStringAsFixed(9)} quanta');
}torusQuanta = 32 flux per plaquette ≈ 32/2760 = 0.011594203 quanta
static const double torusField = 6829 / 187402import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
import 'package:riptide_rational_gauge/classic.ray';
void main() {
// SuperconductorExperiment.torusField: the Cayley parameter per plaquette, 6829/187402, close to tan(π·32/2760).
print('torusField = ${SuperconductorExperiment.torusField}');
final (hr, hi) = cayley(SuperconductorExperiment.torusField);
print('h = e(t) = (${hr.toStringAsFixed(12)}, ${hi.toStringAsFixed(12)}), 2760 plaquettes × flux 2·atan t / 2π ≈ ${(2760 * fluxQuanta([(hr, hi)])).toStringAsFixed(9)} quanta');
}torusField = 0.03644037950502129 h = e(t) = (0.997347719450, 0.072784108900), 2760 plaquettes × flux 2·atan t / 2π ≈ 31.999999958 quanta
static const double weakHalfLength = 4.5import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorExperiment.weakHalfLength: half the weak link's length in sites.
print('weakHalfLength = ${SuperconductorExperiment.weakHalfLength}');
}weakHalfLength = 4.5
static const double jumpField = 0.04The thin ring's slow ramp: to about six quanta through the loop.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorExperiment.jumpField: the thin ring's final field parameter in fluxJumps.
print('jumpField = ${SuperconductorExperiment.jumpField}');
print('ramp: ${SuperconductorExperiment(preset: SuperconductorPreset.fluxJumps, size: 24).fieldRamp.to}');
}jumpField = 0.04 ramp: 0.04
static const int jumpSteps = 24000import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorExperiment.jumpSteps: the length of the slow field ramp in fluxJumps.
print('jumpSteps = ${SuperconductorExperiment.jumpSteps}');
}jumpSteps = 24000
static const double trapHalfField = 1 / 176The field the ring is cooled in, by the Cayley parameter of half its flux per plaquette (h = e(t\tfrac{1}{2})^{2}, \theta_{H} \approx 0.0227: about 4.2 quanta through the middle of the ring), and the winding the condensate takes.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorExperiment.trapHalfField: the Cayley parameter of half the flux per plaquette the ring is cooled in.
print('trapHalfField = ${SuperconductorExperiment.trapHalfField}');
final t = turnRule(SuperconductorExperiment.trapHalfField, SuperconductorExperiment.trapHalfField);
print('full field parameter t = ${t.toStringAsFixed(12)} (turn rule of 1/176 with itself)');
}trapHalfField = 0.005681818181818182 full field parameter t = 0.011364003228 (turn rule of 1/176 with itself)
static const int trapWinding = 4import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorExperiment.trapWinding: the winding the ring's condensate starts with in trapFlux.
print('trapWinding = ${SuperconductorExperiment.trapWinding}');
print('fluxoid at the start (size 64): ${SuperconductorExperiment(preset: SuperconductorPreset.trapFlux).ringWinding()}');
}trapWinding = 4 fluxoid at the start (size 64): 4
static const double meissnerField = 0.015The Meissner disc's field: about 0.4 H_{c} (\theta_{c}^{2} = 2g^{2} \cdot \frac{\alpha^{2}}{2\beta}: \theta_{c} \approx 0.079 per plaquette), below H_{c1}.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorExperiment.meissnerField: the Meissner disc's field parameter (below H_c1).
print('meissnerField = ${SuperconductorExperiment.meissnerField}');
}meissnerField = 0.015
static const int historyEvery = 100import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorExperiment.historyEvery: how often the ring presets record (flux, fluxoid).
print('historyEvery = ${SuperconductorExperiment.historyEvery}');
final e = SuperconductorExperiment(preset: SuperconductorPreset.windThree, size: 24)..advance(300);
print('history after 300 steps: ${e.history.map((h) => (h.$1.toStringAsFixed(3), h.$2)).toList()}');
}historyEvery = 100 history after 300 steps: [(0.000, 3), (0.000, 3), (0.000, 3)]
static const int settleSteps = 2500Steps a preset is given to settle after its script.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// SuperconductorExperiment.settleSteps: steps a preset is given to settle after its script.
print('settleSteps = ${SuperconductorExperiment.settleSteps}');
print('fieldAfterCooling settled at t = 0: ${SuperconductorExperiment(preset: SuperconductorPreset.fieldAfterCooling, size: 16).settled}');
}settleSteps = 2500 fieldAfterCooling settled at t = 0: false
Properties
late GaugeLattice latticelate SuperconductorPreset presetlate SuperconductorType typelate Ramp fieldRampThe applied field's Cayley parameter per plaquette (flux 2 \cdot \operatorname{atan} t \approx 2t per plaquette).
double get dtAThe links' step: 0.1, or \frac{g^{2}}{5} when the magnetic term is stiff (its rate goes up to \frac{8}{g^{2}}; gradient flow is stable below \frac{2g^{2}}{8}).
LinkMaths get mathsset maths(LinkMaths m)import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// maths = …: switch an experiment's link maths mid-run (the state carries over).
final e = SuperconductorExperiment(preset: SuperconductorPreset.windThree, size: 24)..advance(100);
final f0 = e.lattice.energy();
e.maths = LinkMaths.classic;
print('F before ${f0.toStringAsFixed(12)}, after switching ${e.lattice.energy().toStringAsFixed(12)}');
e.advance(100);
print('classic fluxoid after 100 more steps: ${e.ringWinding()}');
}F before -7.214623702528, after switching -7.214623702528 classic fluxoid after 100 more steps: 3
List<int> get loopThe closed path of sites the ring's winding and holonomy are measured round (empty for other shapes).
SuperconductorShape get shapedouble get centreRamp? frontRampThe cooling front's radius (sites), or null when the temperature is uniform.
double get discRadiusdouble get ringOuter(double, double)? get weakLinkAtWhere the weak link is (sites), for drawing; null without one.
final historyFor the ring presets, (field through the loop in quanta, fluxoid n) every historyEvery steps: the sawtooth.
double get appliedLoopQuantaThe applied field's flux through the ring's loop, in quanta (display: \theta_{h} by atan2, classic.ray).
bool get settledWhether the preset's script has played out (its ramps and cooling front done, and some time to settle).
double get fieldScaleThe field scale the drawing uses: \operatorname{Im} h of the strongest field this preset applies.
GLParameters get parametersMethods
void start(SuperconductorPreset p)Starts p from its initial state.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// start(preset): restart the same experiment object on another preset.
final e = SuperconductorExperiment(preset: SuperconductorPreset.fieldEnters, size: 20)..advance(50);
print('${e.preset.name} at t = ${e.t}');
e.start(SuperconductorPreset.windThree);
print('now ${e.preset.name} at t = ${e.t}, fluxoid ${e.ringWinding()}');
}fieldEnters at t = 50 now windThree at t = 0, fluxoid 3
void advance(int n)Runs n relaxation steps, following the preset's temperature and field.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// advance(n): n relaxation steps following the preset's ramps. Field rising on a type-II square, both ways, 600 steps.
final a = SuperconductorExperiment(preset: SuperconductorPreset.fieldEnters, size: 24);
final b = a.twin(LinkMaths.classic);
final fa = <List<double>>[], fb = <List<double>>[];
for (var k = 0; k < 6; k++) {
a.advance(100);
b.advance(100);
fa.add([a.t.toDouble(), a.fluxQuantaInSample()]);
fb.add([b.t.toDouble(), b.fluxQuantaInSample()]);
}
print('after ${a.t} steps: flux in the sample ${a.fluxQuantaInSample().toStringAsFixed(6)} (rational), ${b.fluxQuantaInSample().toStringAsFixed(6)} (classic)');
}after 600 steps: flux in the sample 1.246828 (rational), 1.246828 (classic)
double? coordination()How the vortices pack: for each vortex at least two nearest spacings from the sample's edge, the number of vortices within 1.3× its nearest neighbour's distance, compared by quadrances (Q < 1.69 \cdot Q_{\mathrm{min}}: no root). A triangular lattice gives 6, a square one 4. Null with fewer than one such vortex.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// coordination(): neighbours per vortex within 1.3× the nearest spacing (by quadrances); null with fewer than 7 vortices.
final e = SuperconductorExperiment(preset: SuperconductorPreset.triangularLattice)..advance(700);
final v = e.vortices();
print('${v.length} vortices on the 40 × 69 torus after 700 steps (cooled through T_c by step 400, still ordering); coordination = ${e.coordination()?.toStringAsFixed(3)}');
final g = e.lattice.geometry;
}32 vortices on the 40 × 69 torus after 700 steps (cooled through T_c by step 400, still ordering); coordination = 2.156
SuperconductorExperiment twin(LinkMaths m)The same experiment the other way (or this way), from this one's state now: the two run side by side.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// twin(maths): the same experiment the other way from this state; run both the same 300 steps.
final a = SuperconductorExperiment(preset: SuperconductorPreset.coolInField, size: 24)..advance(100);
final b = a.twin(LinkMaths.classic);
a.advance(300);
b.advance(300);
print('rational: F = ${a.lattice.energy().toStringAsFixed(9)}, inside-field share ${a.insideFieldShare().toStringAsFixed(6)}');
print('classic: F = ${b.lattice.energy().toStringAsFixed(9)}, inside-field share ${b.insideFieldShare().toStringAsFixed(6)}');
}rational: F = -0.803282339, inside-field share 0.668299 classic: F = -0.803282339, inside-field share 0.668299
void setField(double tField, {int steps = 200})Moves the applied field to Cayley parameter tField per plaquette over steps from now.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// setField(t, steps:): ramp the applied field to Cayley parameter t from now.
final e = SuperconductorExperiment(preset: SuperconductorPreset.fieldAfterCooling, size: 20)..advance(10);
e.setField(0.03, steps: 50);
print('t = ${e.t}: field ${e.field.toStringAsFixed(6)}');
e.advance(25);
print('t = ${e.t}: field ${e.field.toStringAsFixed(6)}');
e.advance(25);
print('t = ${e.t}: field ${e.field.toStringAsFixed(6)}');
}t = 10: field 0.000000 t = 35: field 0.015000 t = 60: field 0.030000
void setCold(bool cold, {int steps = 60})Cools below T_{c} or warms above it, everywhere, over steps from now.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// setCold(cold, steps:): cool below T_c or warm above it everywhere; warming destroys the condensate.
final e = SuperconductorExperiment(preset: SuperconductorPreset.fieldAfterCooling, size: 20);
double q() => e.lattice.pr[e.lattice.geometry.index(10, 10)] * e.lattice.pr[e.lattice.geometry.index(10, 10)];
print('cold: ${e.cold}, Q at the centre ${q().toStringAsFixed(6)}');
e.setCold(false, steps: 20);
e.advance(300);
print('after warming: cold ${e.cold}, α = ${e.lattice.alpha}, Q at the centre ${q().toStringAsExponential(2)}');
}cold: true, Q at the centre 0.111111 after warming: cold false, α = 0.1111111111111111, Q at the centre 8.51e-5
void setType(SuperconductorType k)Changes the material (type I or II) from now: \beta, g^{2} and the depth of the hat.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// setType(material): change β, g² and the hat's depth from now.
final e = SuperconductorExperiment(preset: SuperconductorPreset.fieldEnters, size: 20);
print('${e.type.name}: κ² = ${e.parameters.kappa2}');
e.setType(SuperconductorType.typeI);
e.advance(80);
print('${e.type.name}: κ² = ${e.parameters.kappa2}, β = ${e.lattice.beta}, g² = ${e.lattice.g2}, α = ${e.lattice.alpha.toStringAsFixed(6)}');
}typeII: κ² = 4.0 typeI: κ² = 0.25, β = 1.0, g² = 2.0, α = -0.027778
List<(int, int)> vortices()Every vortex: plaquette site and its winding (exact by signs the rational way, by atan2 the classic way).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// vortices(): every vortex (plaquette, winding), exact by signs the rational way, by atan2 the classic way.
final a = SuperconductorExperiment(preset: SuperconductorPreset.fieldCooled, size: 24)..advance(300);
final b = a.twin(LinkMaths.classic);
print('rational: ${a.vortices().length} vortices, net winding ${a.vortices().fold(0, (s, v) => s + v.$2)}');
print('classic (same state): ${b.vortices().length} vortices, net ${b.vortices().fold(0, (s, v) => s + v.$2)}');
final g = a.lattice.geometry;
}rational: 4 vortices, net winding 4 classic (same state): 4 vortices, net 4
double fluxQuantaInSample()The total flux through the sample, in flux quanta: \sum \theta_{p} / 2\pi (classic, atan2 per plaquette).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// fluxQuantaInSample(): Σθ_p/2π over the sample's plaquettes (atan2 per plaquette).
final e = SuperconductorExperiment(preset: SuperconductorPreset.fieldCooled, size: 24);
print('at the start: ${e.fluxQuantaInSample().toStringAsFixed(6)} quanta');
e.advance(200);
print('after 200 steps: ${e.fluxQuantaInSample().toStringAsFixed(6)} quanta');
}at the start: 5.740713 quanta after 200 steps: 5.707774 quanta
int ringWinding()The fluxoid round the ring's loop: exact by signs (rational), by atan2 (classic).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// ringWinding(): the fluxoid round the ring, exact by signs (rational way).
final e = SuperconductorExperiment(preset: SuperconductorPreset.windThree, size: 24);
print('start: ${e.ringWinding()}');
e.advance(300);
print('after 300 steps: ${e.ringWinding()}');
}start: 3 after 300 steps: 3
double ringFluxQuanta()The flux through the ring's loop in quanta (classic: \sum \frac{\theta_{p}}{2\pi} over the plaquettes inside).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// ringFluxQuanta(): the flux through the ring's loop (Σθ_p/2π), in a field switched on round a cold ring.
final e = SuperconductorExperiment(preset: SuperconductorPreset.screenField, size: 24);
e.setField(0.02, steps: 100);
e.advance(400);
print('applied through the loop ${e.appliedLoopQuanta.toStringAsFixed(6)} quanta; actually through it ${e.ringFluxQuanta().toStringAsFixed(6)}; fluxoid ${e.ringWinding()}');
}applied through the loop 1.024821 quanta; actually through it 0.101579; fluxoid 0
double ringHolonomySpread()The holonomy's half-turn spread s = \frac{1 - \operatorname{Re} W}{2} round the loop (Rational; classically \sin^{2}(\frac{\pi\Phi}{\Phi_{0}})): 0 exactly when the enclosed flux is a whole number of quanta.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// ringHolonomySpread(): s = (1 − Re W)/2 round the loop, 0 exactly at whole quanta.
final e = SuperconductorExperiment(preset: SuperconductorPreset.windThree, size: 24);
print('no field: s = ${e.ringHolonomySpread()}');
e.setField(0.02, steps: 1);
e.advance(200);
print('field 0.02: s = ${e.ringHolonomySpread().toStringAsFixed(9)}, flux ${e.ringFluxQuanta().toStringAsFixed(6)} quanta');
}no field: s = 0.0 field 0.02: s = 0.816376625, flux 2.640962 quanta
List<double> fieldProfile()The magnetic field profile along the middle row: \operatorname{Im} U_{p} per plaquette (Rational).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// fieldProfile(): Im U_p along the middle row; the Meissner disc pushes the field out of its middle.
final e = SuperconductorExperiment(preset: SuperconductorPreset.fieldAfterCooling, size: 32)..advance(400);
final p = e.fieldProfile();
print('Im U_p at x = 0, 8, 16: ${p[0].toStringAsFixed(6)}, ${p[8].toStringAsFixed(6)}, ${p[16].toStringAsExponential(2)}');
}Im U_p at x = 0, 8, 16: 0.028593, 0.008142, 2.59e-3
HiggsPreset
enum HiggsPreset
What the Higgs strip starts from.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// The four Higgs-strip presets and where ψ starts.
for (final p in HiggsPreset.values) {
final h = HiggsExperiment(preset: p, length: 64);
print('${p.name}: ψ = (${h.psi.$1}, ${h.psi.$2}), Q = ${h.q}, α(0) = ${h.lattice.alpha}');
}
}rollIntoVacuum: ψ = (0.004, 0.003), Q = 0.000024999999999999998, α(0) = 0.5 lightInVacuum: ψ = (0.0, 0.0), Q = 0.0, α(0) = 0.5 lightInCondensate: ψ = (0.3, 0.4), Q = 0.25, α(0) = -0.5 higgsMode: ψ = (0.36, 0.48), Q = 0.36, α(0) = -0.5
Values
rollIntoVacuumThe field at the top of the hat, a light wave launched: as the field rolls into the vacuum the wave turns massive.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// HiggsPreset.rollIntoVacuum: Q and the photon mass m_A² = 2g²Q over 600 Hamiltonian steps.
final h = HiggsExperiment(preset: HiggsPreset.rollIntoVacuum, length: 128);
final pts = <List<double>>[];
for (var k = 0; k <= 600; k += 20) {
pts.add([k.toDouble(), h.q]);
if (k < 600) h.advance(20);
}
print('Q: start ${pts.first[1].toStringAsFixed(6)}, end ${h.q.toStringAsFixed(6)} (rim Q0 = ${h.q0}); m_A² = ${h.photonMass2.toStringAsFixed(6)}');
}Q: start 0.000025, end 0.250947 (rim Q0 = 0.25); m_A² = 0.501894
lightInVacuumNo condensate (above T_{c}): the wave travels at the speed of light.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// HiggsPreset.lightInVacuum: Q and the photon mass m_A² = 2g²Q over 600 Hamiltonian steps.
final h = HiggsExperiment(preset: HiggsPreset.lightInVacuum, length: 128);
final pts = <List<double>>[];
for (var k = 0; k <= 600; k += 20) {
pts.add([k.toDouble(), h.q]);
if (k < 600) h.advance(20);
}
print('Q: start ${pts.first[1].toStringAsFixed(6)}, end ${h.q.toStringAsFixed(6)} (rim Q0 = ${h.q0}); m_A² = ${h.photonMass2.toStringAsFixed(6)}');
}Q: start 0.000000, end 0.000000 (rim Q0 = 0.0); m_A² = 0.000000
lightInCondensateAlready in the vacuum: the wave is massive from the start (slower, spreading).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// HiggsPreset.lightInCondensate: Q and the photon mass m_A² = 2g²Q over 600 Hamiltonian steps.
final h = HiggsExperiment(preset: HiggsPreset.lightInCondensate, length: 128);
final pts = <List<double>>[];
for (var k = 0; k <= 600; k += 20) {
pts.add([k.toDouble(), h.q]);
if (k < 600) h.advance(20);
}
print('Q: start ${pts.first[1].toStringAsFixed(6)}, end ${h.q.toStringAsFixed(6)} (rim Q0 = ${h.q0}); m_A² = ${h.photonMass2.toStringAsFixed(6)}');
}Q: start 0.250000, end 0.241842 (rim Q0 = 0.25); m_A² = 0.483684
higgsModeThe field displaced outwards from the rim: it rings at the Higgs (amplitude) mass.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// HiggsPreset.higgsMode: Q and the photon mass m_A² = 2g²Q over 600 Hamiltonian steps.
final h = HiggsExperiment(preset: HiggsPreset.higgsMode, length: 128);
final pts = <List<double>>[];
for (var k = 0; k <= 600; k += 20) {
pts.add([k.toDouble(), h.q]);
if (k < 600) h.advance(20);
}
print('Q: start ${pts.first[1].toStringAsFixed(6)}, end ${h.q.toStringAsFixed(6)} (rim Q0 = ${h.q0}); m_A² = ${h.photonMass2.toStringAsFixed(6)}');
}Q: start 0.360000, end 0.361245 (rim Q0 = 0.25); m_A² = 0.722490
HiggsExperiment
final class HiggsExperiment
The Higgs strip: a periodic chain (ny = 1) whose y-links carry a transverse gauge wave A_{y}(x) along x, with a uniform \psi that rolls in the Mexican hat. Hamiltonian evolution (lattice.ray GaugeLattice.evolve).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// The Higgs strip: the field rolls off the top of the hat and the gauge wave turns massive. Both ways, 500 steps.
final a = HiggsExperiment(length: 128), b = a.twin(LinkMaths.classic);
final qa = <List<double>>[], qb = <List<double>>[];
for (var k = 0; k <= 500; k += 25) {
qa.add([k.toDouble(), a.photonMass2]);
qb.add([k.toDouble(), b.photonMass2]);
if (k < 500) {
a.advance(25);
b.advance(25);
}
}
print('rational: m_A² = ${a.photonMass2.toStringAsFixed(6)}, wave centre ${a.waveCentre().toStringAsFixed(3)}');
print('classic: m_A² = ${b.photonMass2.toStringAsFixed(6)}, wave centre ${b.waveCentre().toStringAsFixed(3)}');
}rational: m_A² = 0.483071, wave centre 33.127 classic: m_A² = 0.483319, wave centre 33.162
Constructors
HiggsExperiment({HiggsPreset preset = HiggsPreset.rollIntoVacuum, LinkMaths maths = LinkMaths.rational, this.length = 256})import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// HiggsExperiment({preset, maths, length}): a periodic chain whose y-links carry a transverse wave.
final h = HiggsExperiment(preset: HiggsPreset.lightInCondensate, length: 64);
print('length ${h.length}, maths ${h.maths.name}, Q = ${h.q}, rim ${h.q0}, m_A² = ${h.photonMass2}');
}length 64, maths rational, Q = 0.25, rim 0.25, m_A² = 0.5
Static
static const double alphaBroken = -0.5The hat: V = \alpha Q + (\frac{\beta}{2})Q^{2} with Q_{0} = \frac{1}{4} (\psi_{0} = \frac{1}{2} exactly), g^{2} = 1: m_{A}^{2} = 2g^{2}Q_{0} = \frac{1}{2}, m_{H}^{2} = 2\beta Q_{0} = \frac{1}{2}.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// HiggsExperiment.alphaBroken: α below T_c (the hat's coefficient).
print('alphaBroken = ${HiggsExperiment.alphaBroken}');
print('rim Q0 = ${MexicanHat(HiggsExperiment.alphaBroken, HiggsExperiment.beta).q0}');
}alphaBroken = -0.5 rim Q0 = 0.25
static const double beta = 2The hat: V = \alpha Q + (\frac{\beta}{2})Q^{2} with Q_{0} = \frac{1}{4} (\psi_{0} = \frac{1}{2} exactly), g^{2} = 1: m_{A}^{2} = 2g^{2}Q_{0} = \frac{1}{2}, m_{H}^{2} = 2\beta Q_{0} = \frac{1}{2}.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// HiggsExperiment.beta: the hat's quartic coefficient.
print('beta = ${HiggsExperiment.beta}');
print('Higgs m² = 2βQ0 = ${2 * HiggsExperiment.beta * 0.25}');
}beta = 2.0 Higgs m² = 2βQ0 = 1.0
static const double g2 = 1The hat: V = \alpha Q + (\frac{\beta}{2})Q^{2} with Q_{0} = \frac{1}{4} (\psi_{0} = \frac{1}{2} exactly), g^{2} = 1: m_{A}^{2} = 2g^{2}Q_{0} = \frac{1}{2}, m_{H}^{2} = 2\beta Q_{0} = \frac{1}{2}.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// HiggsExperiment.g2: the gauge coupling g².
print('g2 = ${HiggsExperiment.g2}');
print('photon m² in the vacuum = ${2 * HiggsExperiment.g2 * 0.25}');
}g2 = 1.0 photon m² in the vacuum = 0.5
static const double dt = 0.25import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// HiggsExperiment.dt: the Hamiltonian step size.
print('dt = ${HiggsExperiment.dt}');
print('step spread at the carrier: ${stepSpread(HiggsExperiment.dt, 0.5, HiggsExperiment.carrierU)} (stable below 1)');
}dt = 0.25 step spread at the carrier: 0.012973050458715597 (stable below 1)
static const double carrierU = 0.3The wave packet's carrier: Cayley parameter u = \tan(\frac{k}{2}) (k \approx 0.6), and its width.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// HiggsExperiment.carrierU: the wave carrier's Cayley parameter u = tan(k/2).
print('carrierU = ${HiggsExperiment.carrierU}');
print('lattice k̂² = 4u²/(1 + u²) = ${4 * latticeSpread(HiggsExperiment.carrierU)}');
}carrierU = 0.3 lattice k̂² = 4u²/(1 + u²) = 0.33027522935779813
static const int packetHalfWidth = 24import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// HiggsExperiment.packetHalfWidth: the wave packet's half-width in sites.
print('packetHalfWidth = ${HiggsExperiment.packetHalfWidth}');
}packetHalfWidth = 24
static const double amplitude = 0.3The wave packet's amplitude (A_{y}, radians of link phase at the crest).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// HiggsExperiment.amplitude: the wave packet's crest, radians of link phase.
print('amplitude = ${HiggsExperiment.amplitude}');
final h = HiggsExperiment(preset: HiggsPreset.lightInVacuum, length: 128);
print('largest |A_y| (as Im U) on the strip: ${h.waveA.map((x) => x.abs()).reduce((p, q) => p > q ? p : q).toStringAsFixed(6)}');
}amplitude = 0.3 largest |A_y| (as Im U) on the strip: 0.293399
Properties
final int lengthlate GaugeLattice latticelate HiggsPreset presetLinkMaths get mathsset maths(LinkMaths m)import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// maths = …: switch the strip's link maths mid-run.
final h = HiggsExperiment(preset: HiggsPreset.lightInCondensate, length: 64)..advance(50);
h.maths = LinkMaths.classic;
h.advance(50);
print('maths now ${h.maths.name}, t = ${h.t}, Q = ${h.q.toStringAsFixed(9)}');
}maths now classic, t = 100, Q = 0.250923934
double frictionRadial friction on \psi (gauge invariant), so the field settles on the rim.
int tMexicanHat get hatRamp alphaRampThe temperature: \alpha over time (the hat forms when \alpha turns negative).
List<double> get waveAA_{y} along the strip, the link phase (Im U as the rational measure: \sin A \approx A).
Methods
void start(HiggsPreset p)import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// start(preset): restart the strip on another preset.
final h = HiggsExperiment(length: 64)..advance(30);
h.start(HiggsPreset.higgsMode);
print('${h.preset.name}: t = ${h.t}, Q = ${h.q}, friction ${h.friction}');
}higgsMode: t = 0, Q = 0.36, friction 0.0
void advance(int n)import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// advance(n): Hamiltonian steps. The Higgs mode: Q rings round the rim at the Higgs mass, both ways, 400 steps.
final a = HiggsExperiment(preset: HiggsPreset.higgsMode, length: 32), b = a.twin(LinkMaths.classic);
final pa = <List<double>>[], pb = <List<double>>[];
for (var k = 0; k < 400; k += 4) {
pa.add([k * HiggsExperiment.dt, a.q]);
pb.add([k * HiggsExperiment.dt, b.q]);
a.advance(4);
b.advance(4);
}
print('Q after 400 steps: rational ${a.q.toStringAsFixed(9)}, classic ${b.q.toStringAsFixed(9)}');
}Q after 400 steps: rational 0.174314218, classic 0.174314218
HiggsExperiment twin(LinkMaths m)The same strip the other way, from this one's state now.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// twin(maths): the strip the other way from this state; the same 300 steps each.
final a = HiggsExperiment(preset: HiggsPreset.lightInCondensate, length: 128);
final b = a.twin(LinkMaths.classic);
a.advance(300);
b.advance(300);
print('wave centre after 300 steps: rational ${a.waveCentre().toStringAsFixed(6)}, classic ${b.waveCentre().toStringAsFixed(6)}');
}wave centre after 300 steps: rational 77.450543, classic 77.457725
void setCold(bool cold, {int steps = 40})Hot (\alpha > 0: no hat, \psi settles to 0) or cold (the hat: \psi rolls to the rim), over steps from now.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// setCold(false): warm the strip; the hat flattens into a bowl and Q falls to 0.
final h = HiggsExperiment(preset: HiggsPreset.lightInCondensate, length: 64);
h.setCold(false, steps: 20);
final pts = <List<double>>[];
for (var k = 0; k <= 400; k += 20) {
pts.add([k.toDouble(), h.q]);
h.advance(20);
}
print('cold: ${h.cold}, α = ${h.lattice.alpha}, Q after 400 steps ${h.q.toStringAsExponential(2)}');
}cold: false, α = 0.5, Q after 400 steps 2.35e-10
void launchWave()Sends a new wave packet from a quarter of the way along (replacing the transverse field there).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// launchWave(): a new right-moving packet a quarter of the way along.
final h = HiggsExperiment(preset: HiggsPreset.higgsMode, length: 128);
print('E_y energy before: ${h.waveE.fold(0.0, (s, e) => s + e * e).toStringAsFixed(6)}');
h.launchWave();
print('after launchWave: ${h.waveE.fold(0.0, (s, e) => s + e * e).toStringAsFixed(6)}, centre ${h.waveCentre().toStringAsFixed(3)}');
}E_y energy before: 0.000000 after launchWave: 0.921845, centre 32.000
void nudge()Nudges \psi off the top of the hat (when it sits there) by a small rational step.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// nudge(): step ψ off the top of the hat by (0.004, 0.003).
final h = HiggsExperiment(preset: HiggsPreset.lightInVacuum, length: 32);
print('ψ before ${h.psi}');
h.nudge();
print('ψ after (${h.psi.$1}, ${h.psi.$2})');
}ψ before (0.0, 0.0) ψ after (0.004, 0.003)
double groupVelocity()The group velocity the wave should have in the vacuum, \frac{k}{\sqrt{k^{2} + m_{A}^{2}}} (continuum; Root).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// groupVelocity() = k/√(k² + m_A²): light speed with no condensate, slower in it.
final v0 = HiggsExperiment(preset: HiggsPreset.lightInVacuum, length: 64).groupVelocity();
final v1 = HiggsExperiment(preset: HiggsPreset.lightInCondensate, length: 64).groupVelocity();
print('no condensate: v = ${v0.toStringAsFixed(9)}; in the condensate (m_A² = 1/2): v = ${v1.toStringAsFixed(9)}');
}no condensate: v = 1.000000000; in the condensate (m_A² = 1/2): v = 0.636091046
double waveCentre()The energy-weighted centre of the wave (sites), for measuring how fast it moves.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// waveCentre(): the E²-weighted centre; it moves faster with no condensate. Both presets, the same 200 steps.
final a = HiggsExperiment(preset: HiggsPreset.lightInVacuum, length: 256);
final b = HiggsExperiment(preset: HiggsPreset.lightInCondensate, length: 256);
final pa = <List<double>>[], pb = <List<double>>[];
for (var k = 0; k <= 200; k += 10) {
pa.add([k * HiggsExperiment.dt, a.waveCentre()]);
pb.add([k * HiggsExperiment.dt, b.waveCentre()]);
a.advance(10);
b.advance(10);
}
print('moved in 50 time units: vacuum ${(pa.last[1] - pa.first[1]).toStringAsFixed(3)} sites, condensate ${(pb.last[1] - pb.first[1]).toStringAsFixed(3)} sites');
}moved in 50 time units: vacuum 47.455 sites, condensate 29.983 sites
LatticeGeometry
final class LatticeGeometry
The shape of a 2-D lattice: nx \times ny sites (site i = y \cdot nx + x), a link from each site in +x (\mu = 0) and +y (\mu = 1), link index l = 2i + \mu, open or periodic in each direction, and which sites are superconducting.
Sites that are not superconducting are vacuum (or an insulator): \psi = 0 there, but their links still carry the magnetic field. Hopping (the |D\psi|^{2} term) is only between two superconducting sites, which gives Ginzburg–Landau's natural boundary condition at an insulating surface (no current out of the sample).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// A 6 × 5 lattice with a superconducting disc: sites, links, plaquettes, and which links carry hopping.
final g = LatticeGeometry(6, 5, superconducting: (x, y) => (x - 2.5) * (x - 2.5) + (y - 2) * (y - 2) <= 5);
var hops = 0, plaq = 0, inSample = 0;
for (var l = 0; l < g.links; l++) {
if (g.hop[l] == 1) hops++;
}
for (var i = 0; i < g.sites; i++) {
if (g.plaquette[i] == 1) plaq++;
if (g.plaquetteInSample(i)) inSample++;
}
print('${g.sites} sites, ${g.links} link slots, ${[for (var l = 0; l < g.links; l++) if (g.linkOn(l)) l].length} links, $hops hopping links');
print('$plaq plaquettes, $inSample inside the sample');
}30 sites, 60 link slots, 49 links, 23 hopping links 20 plaquettes, 8 inside the sample
Constructors
LatticeGeometry(this.nx, this.ny, {this.periodicX = false, this.periodicY = false, bool Function(int x, int y)? superconducting})import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// LatticeGeometry(nx, ny, periodicX:, periodicY:, superconducting:): open edges have no outgoing link.
final open = LatticeGeometry(3, 3), torus = LatticeGeometry(3, 3, periodicX: true, periodicY: true);
int count(LatticeGeometry g) => [for (var l = 0; l < g.links; l++) if (g.linkOn(l)) l].length;
print('open 3 × 3: ${count(open)} links; torus 3 × 3: ${count(torus)} links');
print('next of site 2 in +x: open ${open.next[4]}, torus ${torus.next[4]}');
}open 3 × 3: 12 links; torus 3 × 3: 18 links next of site 2 in +x: open -1, torus 0
Properties
final int nxfinal int nyfinal bool periodicXfinal bool periodicYfinal Int32List prevThe site whose \mu-link leads to i (\operatorname{prev}[2i + \mu]), or -1.
int get sitesint get linksMethods
int index(int x, int y)import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// index(x, y) = y·nx + x.
final g = LatticeGeometry(4, 3);
print([for (var y = 0; y < 3; y++) [for (var x = 0; x < 4; x++) g.index(x, y)].join(' ')].join(' | '));
}0 1 2 3 | 4 5 6 7 | 8 9 10 11
int xOf(int i)import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// xOf(i) = i mod nx.
final g = LatticeGeometry(4, 3);
print([for (final i in [0, 3, 5, 11]) 'xOf($i) = ${g.xOf(i)}'].join(', '));
}xOf(0) = 0, xOf(3) = 3, xOf(5) = 1, xOf(11) = 3
int yOf(int i)import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// yOf(i) = i div nx.
final g = LatticeGeometry(4, 3);
print([for (final i in [0, 3, 5, 11]) 'yOf($i) = ${g.yOf(i)}'].join(', '));
}yOf(0) = 0, yOf(3) = 0, yOf(5) = 1, yOf(11) = 2
bool linkOn(int l)Whether link l exists.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// linkOn(l): whether link l = 2i + μ exists (open edges have none outward).
final g = LatticeGeometry(3, 2);
for (var i = 0; i < g.sites; i++) print('site $i (${g.xOf(i)}, ${g.yOf(i)}): +x ${g.linkOn(2 * i)}, +y ${g.linkOn(2 * i + 1)}');
}site 0 (0, 0): +x true, +y true site 1 (1, 0): +x true, +y true site 2 (2, 0): +x false, +y true site 3 (0, 1): +x true, +y false site 4 (1, 1): +x true, +y false site 5 (2, 1): +x false, +y false
(int, int, int, int) plaquetteLinks(int i)The four links of the plaquette at i, with the orientation the plaquette product uses: U_{p} = U_{x}(i) \cdot U_{y}(i + \hat{x}) \cdot \operatorname{conj}(U_{x}(i + \hat{y})) \cdot \operatorname{conj}(U_{y}(i)).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// plaquetteLinks(i): the four links of the plaquette at i, in the order U_p multiplies them.
final g = LatticeGeometry(3, 3);
final (l1, l2, l3, l4) = g.plaquetteLinks(g.index(1, 1));
print('plaquette at (1, 1): links $l1 (x from (1,1)), $l2 (y from (2,1)), $l3 (x from (1,2)), $l4 (y from (1,1))');
}plaquette at (1, 1): links 8 (x from (1,1)), 11 (y from (2,1)), 14 (x from (1,2)), 9 (y from (1,1))
bool plaquetteInSample(int i)Whether all four corners of the plaquette at i are superconducting (a vortex can be counted there).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// plaquetteInSample(i): all four corners superconducting, so a vortex can be counted there.
final g = LatticeGeometry(4, 4, superconducting: (x, y) => x >= 1);
print([for (var y = 0; y < 3; y++) [for (var x = 0; x < 3; x++) g.plaquetteInSample(g.index(x, y)) ? 'in' : 'out'].join(' ')].join(' | '));
}out in in | out in in | out in in
(List<int>, List<int>) discLoop(double cx, double cy, double r2)A closed counter-clockwise path of sites round the plaquettes whose centres lie within quadrance r2 of (cx, cy) (a digital disc: compared by quadrance, no root), and those plaquettes. The boundary edges are the plaquette edges with the disc on their left, chained head to tail.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// discLoop(cx, cy, r²): a counter-clockwise path of sites round a digital disc of plaquettes (compared by quadrance).
final g = LatticeGeometry(10, 10);
final (path, interior) = g.discLoop(4.5, 4.5, 6);
print('${interior.length} plaquettes inside, path of ${path.length} sites: ${path.take(8).join(', ')}, …');
}21 plaquettes inside, path of 20 sites: 23, 24, 25, 26, 36, 37, 47, 57, …
LinkMaths
enum LinkMaths
How the link variables are stored and turned.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// LinkMaths: how links are stored and turned. Same lattice, same 300 relaxation steps, both ways.
final g = LatticeGeometry(12, 12);
final e = <LinkMaths, List<List<double>>>{};
for (final m in LinkMaths.values) {
final l = GaugeLattice(g, maths: m, alpha: -0.25, beta: 1, g2: 0.5)..setFieldParameter(0.04);
l.setPsi((x, y) => (0.5, 0.0));
e[m] = [];
for (var k = 0; k <= 300; k++) {
if (k % 10 == 0) e[m]!.add([k.toDouble(), l.energy()]);
if (k < 300) l.relax(0.1);
}
print('${m.name}: F after 300 steps = ${l.energy().toStringAsFixed(9)}, max ||U|² − 1| = ${l.unitDrift().toStringAsExponential(1)}');
}
}classic: F after 300 steps = -4.079001746, max ||U|² − 1| = 2.2e-16 rational: F after 300 steps = -4.079001746, max ||U|² − 1| = 2.2e-16
Values
classicimport 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// LinkMaths.classic keeps angles θ and rebuilds U = (cos θ, sin θ) after every turn.
final l = GaugeLattice(LatticeGeometry(4, 4), maths: LinkMaths.classic)..setFieldParameter(0.1);
l.setPsi((x, y) => (1.0, 0.0));
for (var k = 0; k < 20; k++) l.relax(0.1);
print('θ of link 1 = ${l.th[1].toStringAsFixed(9)}, U = (${l.ur[1].toStringAsFixed(9)}, ${l.ui[1].toStringAsFixed(9)})');
}θ of link 1 = -0.054584829, U = (0.998510618, -0.054557727)
rationalimport 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// LinkMaths.rational turns U by Cayley points; no angle is stored (th stays 0).
final l = GaugeLattice(LatticeGeometry(4, 4))..setFieldParameter(0.1);
l.setPsi((x, y) => (1.0, 0.0));
for (var k = 0; k < 20; k++) l.relax(0.1);
print('maths = ${l.maths.name}; θ array untouched: ${l.th[1]}; U = (${l.ur[1].toStringAsFixed(9)}, ${l.ui[1].toStringAsFixed(9)})');
}maths = rational; θ array untouched: 0.0; U = (0.998510617, -0.054557749)
GaugeLattice
final class GaugeLattice
The lattice model in doubles (the live labs run this).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// A superconducting square in a field, relaxed both ways for 400 steps: the field is pushed out of the middle.
// The plot shows the link variables' Im U_p (the field) along the middle row, both ways.
final g = LatticeGeometry(20, 20, superconducting: (x, y) => x >= 3 && x < 17 && y >= 3 && y < 17);
final profiles = <String, List<List<double>>>{};
for (final m in LinkMaths.values) {
final l = GaugeLattice(g, maths: m, alpha: -0.25, beta: 1, g2: 0.5)..setFieldParameter(0.03);
l.setPsi((x, y) => (0.5, 0.0));
for (var k = 0; k < 400; k++) l.relax(0.1);
profiles[m.name] = [for (var x = 0; x < 19; x++) [x + 0.5, l.plaquetteAt(g.index(x, 10)).$2]];
print('${m.name}: F = ${l.energy().toStringAsFixed(8)}, Im U_p at the edge ${l.plaquetteAt(g.index(1, 10)).$2.toStringAsFixed(6)}, in the middle ${l.plaquetteAt(g.index(10, 10)).$2.toStringAsExponential(2)}');
}
}classic: F = -5.76023021, Im U_p at the edge 0.059939, in the middle 7.47e-3 rational: F = -5.76023021, Im U_p at the edge 0.059939, in the middle 7.47e-3
Constructors
GaugeLattice(this.geometry, {LinkMaths maths = LinkMaths.rational, this.alpha = -1, this.beta = 1, this.g2 = 1})import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// GaugeLattice(geometry, maths:, alpha:, beta:, g2:): ψ = 0 and U = 1 to start.
final l = GaugeLattice(LatticeGeometry(5, 5), alpha: -1, beta: 1, g2: 1);
print('maths ${l.maths.name}, α ${l.alpha}, β ${l.beta}, g² ${l.g2}, F = ${l.energy()}');
l.setPsi((x, y) => (1.0, 0.0));
print('on the rim (Q = 1): F = ${l.energy()} = 25·(α + β/2)');
}maths rational, α -1.0, β 1.0, g² 1.0, F = 0.0 on the rim (Q = 1): F = -12.5 = 25·(α + β/2)
Properties
final LatticeGeometry geometryfinal Float64List urU per link (real, imaginary); the classic way keeps them equal to (\cos \theta, \sin \theta).
final Float64List uiU per link (real, imaginary); the classic way keeps them equal to (\cos \theta, \sin \theta).
final Float64List grThe last forces: \frac{\partial F}{\partial\bar{\psi}} per site and \frac{\partial F}{\partial\theta} per link.
final Float64List giThe last forces: \frac{\partial F}{\partial\bar{\psi}} per site and \frac{\partial F}{\partial\theta} per link.
final Float64List flThe last forces: \frac{\partial F}{\partial\bar{\psi}} per site and \frac{\partial F}{\partial\theta} per link.
double alphaThe potential \alpha Q + (\frac{\beta}{2})Q^{2} (\alpha < 0: below T_{c}, the Mexican hat).
double betaThe potential \alpha Q + (\frac{\beta}{2})Q^{2} (\alpha < 0: below T_{c}, the Mexican hat).
Float64List? alphaMap\alpha per site, when the temperature isn't uniform (a cooling front); null: alpha everywhere.
bool renormalizeIn the rational way, hold |U| to rounding by the quadrance correction U \leftarrow \frac{U(3 - Q)}{2} after each turn.
double g2The gauge coupling g^{2} (the charge squared): \frac{1}{g^{2}} weighs the magnetic energy.
LinkMaths get mathsset maths(LinkMaths m)Switches the way the links are kept. The state carries over: to classic, \theta = \operatorname{atan2}(im, re) (in classic.ray); to rational, U as it is.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// Switching ways mid-run: to classic, θ = atan2(Im U, Re U); the state carries over.
final l = GaugeLattice(LatticeGeometry(6, 6))..setFieldParameter(0.05);
l.setPsi((x, y) => (1.0, 0.0));
for (var k = 0; k < 50; k++) l.relax(0.1);
final before = l.energy();
l.maths = LinkMaths.classic;
print('energy before and after switching: ${before.toStringAsFixed(12)}, ${l.energy().toStringAsFixed(12)}');
print('θ of link 0 now ${l.th[0].toStringAsFixed(9)}');
}energy before and after switching: -17.907373592774, -17.907373592774 θ of link 0 now 0.028137748
int stepsMethods
void copyStateFrom(GaugeLattice o)Copies o's state (same geometry): fields, parameters and the applied field; the classic angles from the links.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// copyStateFrom(o): run a classic twin from a rational lattice's state, then compare after 100 more steps each.
final g = LatticeGeometry(8, 8);
final a = GaugeLattice(g)..setFieldParameter(0.05);
a.setPsi((x, y) => (0.8, 0.0));
for (var k = 0; k < 50; k++) a.relax(0.1);
final b = GaugeLattice(g, maths: LinkMaths.classic)..copyStateFrom(a);
for (var k = 0; k < 100; k++) {
a.relax(0.1);
b.relax(0.1);
}
print('rational F = ${a.energy().toStringAsFixed(10)}, classic F = ${b.energy().toStringAsFixed(10)}');
}rational F = -31.8022885252, classic F = -31.8022885252
void setPsi((double, double) Function(int x, int y) value)Sets \psi everywhere superconducting from value (x, y) → (re, im), zero elsewhere; \pi cleared.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// setPsi((x, y) → ψ): a vortex-like start ψ = (x − c) + i(y − c), zero outside the sample.
final g = LatticeGeometry(6, 6, superconducting: (x, y) => x > 0);
final l = GaugeLattice(g)..setPsi((x, y) => ((x - 2.5) / 3, (y - 2.5) / 3));
print('ψ(0, 0) = (${l.pr[0]}, ${l.pi[0]}) (vacuum), ψ(1, 0) = (${l.pr[1]}, ${l.pi[1]})');
print('vortex at the centre plaquette: ${l.vortexAt(g.index(2, 2))}');
}ψ(0, 0) = (0.0, 0.0) (vacuum), ψ(1, 0) = (-0.5, -0.8333333333333334) vortex at the centre plaquette: 1
void setLinks((double, double) Function(int x, int y, int mu) value)Sets every link from value (x, y, \mu) \to U (re, im), and the classic angles from it.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// setLinks((x, y, μ) → U): a uniform field in the Landau gauge, U_y(x) = e(t)^x.
const t = 0.1;
final (hr, hi) = cayley(t);
final g = LatticeGeometry(5, 5);
final l = GaugeLattice(g)..setLinks((x, y, mu) {
if (mu == 0) return (1.0, 0.0);
var r = 1.0, i = 0.0;
for (var k = 0; k < x; k++) (r, i) = (r * hr - i * hi, r * hi + i * hr);
return (r, i);
});
print('U_p at (1, 1) = (${l.plaquetteAt(g.index(1, 1)).$1.toStringAsFixed(12)}, ${l.plaquetteAt(g.index(1, 1)).$2.toStringAsFixed(12)}) = e(0.1) = $hr, $hi');
}U_p at (1, 1) = (0.980198019802, 0.198019801980) = e(0.1) = 0.9801980198019802, 0.19801980198019803
void setFieldParameter(double t)The applied field's phase per plaquette, by its Cayley parameter: h = e(t), a flux of 2 \cdot \operatorname{atan} t per plaquette.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// setFieldParameter(t): the applied field per plaquette as a Cayley point h = e(t) (flux 2·atan t).
final l = GaugeLattice(LatticeGeometry(3, 3))..setFieldParameter(0.5);
print('h = (${l.hr}, ${l.hi})');
}h = (0.6, 0.8)
void computeForces()import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// computeForces(): ∂F/∂ψ̄ per site and ∂F/∂θ per link (the supercurrent plus the curl of B).
final g = LatticeGeometry(3, 1);
final l = GaugeLattice(g, alpha: -1, beta: 1, g2: 1)..setPsi((x, y) => (1.0, 0.0));
l.setLinks((x, y, mu) => mu == 0 ? cayley(0.5) : (1.0, 0.0));
l.computeForces();
print('∂F/∂ψ̄: ${[for (var i = 0; i < 3; i++) '(${l.gr[i].toStringAsFixed(4)}, ${l.gi[i].toStringAsFixed(4)})'].join(' ')}');
print('∂F/∂θ on the x-links: ${l.fl[0].toStringAsFixed(4)}, ${l.fl[2].toStringAsFixed(4)} (2 Im(ψ̄_j U ψ_i) = 2·(4/5))');
}∂F/∂ψ̄: (0.4000, 0.8000) (0.8000, 0.0000) (0.4000, -0.8000) ∂F/∂θ on the x-links: 1.6000, 1.6000 (2 Im(ψ̄_j U ψ_i) = 2·(4/5))
(double, double) plaquetteAt(int i)U_{p} at the plaquette whose lower-left corner is i (1 where there is none).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// plaquetteAt(i): U_p, the field through the plaquette as a unit complex number.
final g = LatticeGeometry(3, 3);
final l = GaugeLattice(g)..setLinks((x, y, mu) => mu == 1 && x == 1 ? cayley(0.25) : (1.0, 0.0));
print('U_p at (0, 0) = ${l.plaquetteAt(g.index(0, 0))}');
print('U_p at (1, 0) = ${l.plaquetteAt(g.index(1, 0))}');
print('U_p at (2, 2) (no plaquette) = ${l.plaquetteAt(g.index(2, 2))}');
}U_p at (0, 0) = (0.8823529411764706, 0.47058823529411764) U_p at (1, 0) = (0.8823529411764706, -0.47058823529411764) U_p at (2, 2) (no plaquette) = (1.0, 0.0)
double energy()The free energy F.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// energy(): the Ginzburg–Landau free energy; it decreases step by step under relax.
final l = GaugeLattice(LatticeGeometry(10, 10), alpha: -0.25, beta: 1, g2: 0.5)..setFieldParameter(0.05);
l.setPsi((x, y) => (0.3, 0.1));
final pts = <List<double>>[];
for (var k = 0; k <= 100; k++) {
if (k % 5 == 0) pts.add([k.toDouble(), l.energy()]);
l.relax(0.1);
}
print('F at steps 0, 50, 100: ${pts[0][1].toStringAsFixed(6)}, ${pts[10][1].toStringAsFixed(6)}, ${pts[20][1].toStringAsFixed(6)}');
}F at steps 0, 50, 100: -1.192020, -2.707093, -2.741165
double hamiltonian()The Hamiltonian (\frac{g^{2}}{2})\Sigma E^{2} + \Sigma|\pi|^{2} + F.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// hamiltonian() = (g²/2)ΣE² + Σ|π|² + F, under evolve, both ways, the same 400 steps.
final g = LatticeGeometry(16, 1, periodicX: true, periodicY: true);
final series = <Map<String, Object>>[];
for (final m in LinkMaths.values) {
final l = GaugeLattice(g, maths: m, alpha: -0.5, beta: 2, g2: 1)..setPsi((x, y) => (0.3, 0.4));
l.setLinks((x, y, mu) => mu == 1 ? cayley(0.1 * (x < 8 ? 1 : -1)) : (1.0, 0.0));
final h0 = l.hamiltonian(), pts = <List<double>>[];
for (var k = 0; k <= 400; k++) {
if (k % 20 == 0) pts.add([k.toDouble(), l.hamiltonian() - h0]);
l.evolve(0.1);
}
series.add({'label': m.name, 'points': pts});
print('${m.name}: H(0) = ${h0.toStringAsFixed(9)}, H(400) − H(0) = ${(l.hamiltonian() - h0).toStringAsExponential(2)}');
}
}classic: H(0) = -0.684736791, H(400) − H(0) = 1.63e-3 rational: H(0) = -0.684736791, H(400) − H(0) = 1.63e-3
void relax(double dt, {double? dtA})One step of time-dependent Ginzburg–Landau (gradient flow): \psi \leftarrow \psi - dt \cdot \frac{\partial F}{\partial\bar{\psi}}, \theta \leftarrow \theta − dtA·\frac{\partial F}{\partial\theta}.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// relax(dt, dtA:): one gradient-flow step; ψ settles on the rim Q₀ = −α/β.
final l = GaugeLattice(LatticeGeometry(6, 6), alpha: -0.5, beta: 2)..setPsi((x, y) => (0.05, 0.0));
final pts = <List<double>>[];
for (var k = 0; k <= 60; k++) {
pts.add([k.toDouble(), l.pr[14] * l.pr[14] + l.pi[14] * l.pi[14]]);
l.relax(0.2);
}
print('Q at the middle after 60 steps = ${pts.last[1].toStringAsFixed(9)} (rim Q0 = 0.25)');
}Q at the middle after 60 steps = 0.249915567 (rim Q0 = 0.25)
void evolve(double dt, {double radialFriction = 0})One step of the Hamiltonian evolution (symplectic Euler): E \leftarrow E - dt \cdot \frac{\partial F}{\partial\theta}, \pi \leftarrow \pi - dt \cdot \frac{\partial F}{\partial\bar{\psi}}, then the links turn by dt \cdot g^{2}E and \psi \leftarrow \psi + dt \cdot \pi. radialFriction damps only π's component along \psi (gauge invariant: Gauss's law is untouched), so the field settles on the rim of the hat without damping the waves' charge.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// evolve(dt): Hamiltonian real-time step. Gauss's law, both ways, after the same 200 steps.
final g = LatticeGeometry(6, 6, periodicX: true, periodicY: true);
for (final m in LinkMaths.values) {
final l = GaugeLattice(g, maths: m, alpha: -0.5, beta: 2, g2: 1)..setPsi((x, y) => (0.3 + 0.02 * x, 0.4 - 0.03 * y));
final g0 = [for (var i = 0; i < g.sites; i++) l.gauss(i)];
for (var k = 0; k < 200; k++) l.evolve(0.1);
var worst = 0.0;
for (var i = 0; i < g.sites; i++) {
final d = (l.gauss(i) - g0[i]).abs();
if (d > worst) worst = d;
}
print('${m.name}: max |Gauss(200) − Gauss(0)| = ${worst == 0 ? '0' : worst < 1e-14 ? 'nonzero, below 1e-14 (rounding)' : worst}');
}
}classic: max |Gauss(200) − Gauss(0)| = nonzero, below 1e-14 (rounding) rational: max |Gauss(200) − Gauss(0)| = nonzero, below 1e-14 (rounding)
double gauss(int i)Gauss's law at site i: \sum_{\mathrm{out}} E - \sum_{in} E + 2 \operatorname{Im}(\bar{\pi}_{i} \psi_{i}) (conserved by evolve).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// gauss(i) = Σ_out E − Σ_in E + 2 Im(π̄ψ): put a little E on one link and see the two ends.
final g = LatticeGeometry(3, 3, periodicX: true, periodicY: true);
final l = GaugeLattice(g);
l.el[0] = 0.25; // the +x link from site 0 to site 1
print([for (var i = 0; i < g.sites; i++) l.gauss(i)].join(', '));
}0.25, -0.25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
int vortexAt(int i)The vortex number of the plaquette at i, counted exactly by signs (winding.ray): the winding of \psi carried round the plaquette by the links, closed by the plaquette's own phase. 0 outside the sample or where \psi = 0.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// vortexAt(i): the winding of ψ carried round a plaquette, counted exactly by signs.
final g = LatticeGeometry(8, 8);
final l = GaugeLattice(g)..setPsi((x, y) => (x - 3.5, y - 3.5));
final v = [for (var i = 0; i < g.sites; i++) if (l.vortexAt(i) != 0) (g.xOf(i), g.yOf(i), l.vortexAt(i))];
print('vortices (x, y, n): $v');
final a = GaugeLattice(g)..setPsi((x, y) => (x - 3.5, -(y - 3.5)));
print('conjugate field: ${[for (var i = 0; i < g.sites; i++) if (a.vortexAt(i) != 0) a.vortexAt(i)]}');
}vortices (x, y, n): [(3, 3, 1)] conjugate field: [-1]
int fluxoid(List<int> path, List<int> interior)The fluxoid of a closed path of neighbouring sites (counter-clockwise round interior, the plaquettes it encloses): (\frac{1}{2\pi})[\sum_{\mathrm{links}} (\Delta\varphi - A) + \sum_{p} \theta_{p}], an integer, counted exactly by signs. The polygon: \psi carried back to the start link by link (each step turns by one gauge-invariant phase difference), then turned on by each enclosed plaquette's U_{p} in turn (each step one plaquette's flux), which by Stokes ends exactly where it began.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// fluxoid(path, interior): phase winding plus enclosed flux, an integer, counted by signs.
final g = LatticeGeometry(12, 12);
final (path, inside) = g.discLoop(5.5, 5.5, 12);
final l = GaugeLattice(g)..setPsi((x, y) {
// ψ winding twice round the centre: ((x − c) + i(y − c))².
final a = x - 5.5, b = y - 5.5;
return (a * a - b * b, 2 * a * b);
});
print('loop of ${path.length} sites round ${inside.length} plaquettes: fluxoid = ${l.fluxoid(path, inside)}');
}loop of 28 sites round 37 plaquettes: fluxoid = 2
(List<double>, List<double>) fluxoidPolygon(List<int> path, List<int> interior)The polygon fluxoid winds (the classic count sums the same steps by atan2).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// fluxoidPolygon: the polygon whose winding is the fluxoid (ψ carried link by link, then turned by each U_p).
final g = LatticeGeometry(8, 8);
final (path, inside) = g.discLoop(3.5, 3.5, 5);
final l = GaugeLattice(g)..setPsi((x, y) => (x - 3.5, y - 3.5));
final (re, im) = l.fluxoidPolygon(path, inside);
print('${re.length} vertices; winding by signs = ${windingOf(re, im)}');
}41 vertices; winding by signs = 1
(double, double) holonomy(List<int> path)The holonomy \prod U round a closed path (a unit complex number; e^{i\Phi} for the enclosed flux \Phi).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// holonomy(path) = ΠU round a loop = e^{iΦ}: in a uniform field h = e(t) it is h^(plaquettes inside).
final g = LatticeGeometry(8, 8);
final (hr, hi) = cayley(0.05);
final l = GaugeLattice(g)..setLinks((x, y, mu) {
if (mu == 0) return (1.0, 0.0);
var r = 1.0, i = 0.0;
for (var k = 0; k < x; k++) (r, i) = (r * hr - i * hi, r * hi + i * hr);
return (r, i);
});
final (path, inside) = g.discLoop(3.5, 3.5, 5);
final (wr, wi) = l.holonomy(path);
var pr = 1.0, pi = 0.0;
for (var k = 0; k < inside.length; k++) (pr, pi) = (pr * hr - pi * hi, pr * hi + pi * hr);
print('W = (${wr.toStringAsFixed(12)}, ${wi.toStringAsFixed(12)})');
print('h^${inside.length} = (${pr.toStringAsFixed(12)}, ${pi.toStringAsFixed(12)})');
print('half-turn spread of W = ${halfTurnSpread(wr).toStringAsFixed(12)}');
}W = (-0.503336980130, 0.864090206190) h^21 = (-0.503336980130, 0.864090206190) half-turn spread of W = 0.751668490065
void applyGauge(List<double> gRe, List<double> gIm)Applies the gauge transformation g_{i} = (gRei, gImi) (unit numbers): \psi \to g\psi, \pi \to g\pi, U_{l} \to g_{j} U_{l} \bar{g}_{i}.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// applyGauge(gRe, gIm): ψ → gψ, U → g_j U ḡ_i; the energy is unchanged (to rounding in doubles).
final g = LatticeGeometry(6, 6);
final l = GaugeLattice(g)..setFieldParameter(0.07)..setPsi((x, y) => (0.5 + 0.1 * x, 0.2 * y));
for (var k = 0; k < 30; k++) l.relax(0.1);
final e0 = l.energy();
final turns = [for (var i = 0; i < g.sites; i++) cayley((i % 7 - 3) / 4)];
l.applyGauge([for (final t in turns) t.$1], [for (final t in turns) t.$2]);
print('F before ${e0.toStringAsFixed(12)}, after ${l.energy().toStringAsFixed(12)}, |difference| ${(l.energy() - e0).abs() < 1e-12 ? 'below 1e-12' : (l.energy() - e0).abs()}');
}F before -17.818820525577, after -17.818820525577, |difference| below 1e-12
void noise(double amplitude, {int seed = 1})Small random \psi on the superconducting sites (seeded): the fluctuations a cooling sample starts from.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// noise(amplitude, seed:): small seeded random ψ, what a cooling sample starts from.
final l = GaugeLattice(LatticeGeometry(4, 4))..noise(0.01, seed: 3);
print('ψ(0) = (${l.pr[0].toStringAsFixed(6)}, ${l.pi[0].toStringAsFixed(6)}), ψ(5) = (${l.pr[5].toStringAsFixed(6)}, ${l.pi[5].toStringAsFixed(6)})');
}ψ(0) = (-0.002736, -0.008795), ψ(5) = (-0.002685, 0.009043)
double unitDrift()Max ||U|{}^{2}- 1| over the links (0 for the classic way by construction, rounding for the rational way).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// unitDrift(): max ||U|² − 1|, both ways and the rational way without its quadrance correction; 500 steps each.
final g = LatticeGeometry(10, 10);
for (final (name, m, fix) in [('classic', LinkMaths.classic, true), ('rational', LinkMaths.rational, true), ('rational, no correction', LinkMaths.rational, false)]) {
final l = GaugeLattice(g, maths: m)..setFieldParameter(0.05)..setPsi((x, y) => (0.7, 0.1));
l.renormalize = fix;
for (var k = 0; k < 500; k++) l.relax(0.1);
print('$name: ${l.unitDrift().toStringAsExponential(1)}');
}
}classic: 2.2e-16 rational: 2.2e-16 rational, no correction: 2.0e-15
MexicanHat
final class MexicanHat
The Mexican hat V(Q) = \alpha Q + (\frac{\beta}{2})Q^{2} in the quadrance Q = |\psi|^{2} (the Ginzburg–Landau potential).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// The Mexican hat V(Q) = αQ + (β/2)Q² in the quadrance Q = |ψ|²: its rim Q₀ = −α/β and depth −α²/(2β) are rational.
const h = MexicanHat(-0.5, 2);
print('rim Q0 = ${h.q0}, depth V(Q0) = ${h.depth}, slope at the rim ${h.slope(h.q0)}');
print('V(0) = ${h.v(0)}, V(Q0) = ${h.v(h.q0)}, V(1/2) = ${h.v(0.5)}');
}rim Q0 = 0.25, depth V(Q0) = -0.0625, slope at the rim 0.0 V(0) = 0.0, V(Q0) = -0.0625, V(1/2) = 0.0
Constructors
const MexicanHat(this.alpha, this.beta)import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// MexicanHat(α, β): α < 0 below T_c (a rim), α > 0 above (a bowl).
const cold = MexicanHat(-1, 1), hot = MexicanHat(1, 1);
print('cold: Q0 = ${cold.q0}, depth ${cold.depth}; hot: Q0 = ${hot.q0}, depth ${hot.depth}');
}cold: Q0 = 1.0, depth -0.5; hot: Q0 = 0.0, depth 0.0
Properties
final double alphafinal double betadouble get q0The rim (the vacuum): Q_{0} = -\frac{\alpha}{\beta}, rational (|\psi_{0}| = \sqrt{Q_{0}} would be a root; the lab never needs it).
double get depthThe depth of the rim below the top: V(Q_{0}) = -\frac{\alpha^{2}}{2\beta}.
Methods
double v(double q)import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// v(Q): the potential at quadrance Q.
const h = MexicanHat(-1, 1);
print([for (final q in [0.0, 0.5, 1.0, 1.5, 2.0]) 'V($q) = ${h.v(q)}'].join(', '));
}V(0.0) = 0.0, V(0.5) = -0.375, V(1.0) = -0.5, V(1.5) = -0.375, V(2.0) = 0.0
double slope(double q)V'(Q) = \alpha + \beta Q: ψ's restoring force is -V'(Q)\psi.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// slope(Q) = V′(Q) = α + βQ: ψ is pushed by −V′(Q)ψ, zero on the rim.
const h = MexicanHat(-0.5, 2);
print([for (final q in [0.0, 0.25, 0.5]) "V'($q) = ${h.slope(q)}"].join(', '));
}V'(0.0) = -0.5, V'(0.25) = 0.0, V'(0.5) = 0.5
GLParameters
final class GLParameters
Lattice units (spacing 1) of the model in lattice.ray: hopping weight 1, potential \alpha Q + (\frac{\beta}{2})Q^{2}, magnetic weight \frac{1}{g^{2}}.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// Ginzburg–Landau in lattice units: ξ², λ², κ² and the masses as squares; type II when κ² > 1/2.
const p = GLParameters(alpha: -0.25, beta: 4, g2: 0.5);
print('Q0 = ${p.q0}, ξ² = ${p.xi2}, λ² = ${p.lambda2}, κ² = ${p.kappa2}, type II: ${p.typeII}');
print('photon m² = ${p.photonMass2}, Higgs m² = ${p.higgsMass2}, ratio = ${p.higgsMass2 / p.photonMass2} = 2κ²');
}Q0 = 0.0625, ξ² = 4.0, λ² = 16.0, κ² = 4.0, type II: true photon m² = 0.0625, Higgs m² = 0.5, ratio = 8.0 = 2κ²
Constructors
const GLParameters({required this.alpha, required this.beta, required this.g2})import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// GLParameters(alpha:, beta:, g2:): the type-I and type-II materials of the lab.
for (final (name, p) in [('type I', const GLParameters(alpha: -1 / 36, beta: 1, g2: 2)), ('type II', const GLParameters(alpha: -0.25, beta: 4, g2: 0.5))]) {
print('$name: κ² = ${p.kappa2}, type II: ${p.typeII}');
}
}type I: κ² = 0.25, type II: false type II: κ² = 4.0, type II: true
Properties
final double alphafinal double betafinal double g2double get lambda2\lambda^{2} = \frac{1}{2g^{2}Q_{0}} (the London penetration depth squared): no root.
double get kappa2\kappa^{2} = \frac{\lambda^{2}}{\xi^{2}} = \frac{\beta}{2g^{2}}; type II when \kappa^{2} > \frac{1}{2} (\kappa > \frac{1}{\sqrt{2}}), with no root.
bool get typeIIdouble get photonMass2The photon's mass squared in the condensate, m_{A}^{2} = 2g^{2}Q_{0} = \frac{1}{\lambda^{2}}.
double get higgsMass2The Higgs (amplitude) mode's mass squared, m_{H}^{2} = 2\beta Q_{0} = -2\alpha; \frac{m_{H}^{2}}{m_{A}^{2}} = 2\kappa^{2}.
Electroweak
final class Electroweak
The electroweak masses at tree level from g^{2}, g'^{2} and v^{2} (all squares: Rational).
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// Tree-level electroweak masses from squares only; the weak mixing spread s_W = g′²/(g² + g′²).
const e = Electroweak.standard;
print('m_W² = ${e.mW2.toStringAsFixed(3)} GeV², m_Z² = ${e.mZ2.toStringAsFixed(3)} GeV²');
print('s_W = ${e.sW.toStringAsFixed(6)}, c_W = ${e.cW.toStringAsFixed(6)}, m_W²/m_Z² = ${(e.mW2 / e.mZ2).toStringAsFixed(6)}');
print('photon m² = ${e.photonMass2}');
}m_W² = 6431.398 GeV², m_Z² = 8359.574 GeV² s_W = 0.230655, c_W = 0.769345, m_W²/m_Z² = 0.769345 photon m² = 0.0
Constructors
const Electroweak({required this.g2, required this.gp2, required this.v2})import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// Electroweak(g2:, gp2:, v2:): any couplings; equal g and g′ give s_W = 1/2.
const e = Electroweak(g2: 0.25, gp2: 0.25, v2: 4);
print('s_W = ${e.sW}, m_W² = ${e.mW2}, m_Z² = ${e.mZ2}');
}s_W = 0.5, m_W² = 0.25, m_Z² = 0.5
Static
static const standard = Electroweak(g2: 0.652 * 0.652, gp2: 0.357 * 0.357, v2: 246.0 * 246.0)g = 0.652, g' = 0.357, v = 246 GeV.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// Electroweak.standard: g = 0.652, g′ = 0.357, v = 246 GeV.
const e = Electroweak.standard;
print('g² = ${e.g2.toStringAsFixed(6)}, g′² = ${e.gp2.toStringAsFixed(6)}, v² = ${e.v2}');
print('s_W = ${e.sW.toStringAsFixed(4)}');
}g² = 0.425104, g′² = 0.127449, v² = 60516.0 s_W = 0.2307
Properties
final double g2final double gp2final double v2double get sWThe weak mixing spread s_{W} = \frac{g'^{2}}{g^{2} + g'^{2}} (classically \sin^{2}\theta_{W}): the spread between (g, g') and the g axis.
double get photonMass2The photon stays massless: the combination g'W³ + gB the vacuum doesn't charge.
Methods
double higgsMass2(double lambda)m_{h}^{2} = 2\lambda v^{2} for the Higgs self-coupling \lambda.
import 'package:riptide_kepler/riptide_kepler.ray' show ExactArith, F64Arith;
import 'package:riptide_precision/riptide_precision.ray' show Rational;
import 'package:riptide_rational_gauge/riptide_rational_gauge.ray';
import 'raya:convert';
void main() {
// higgsMass2(λ) = 2λv²; λ ≈ 0.129 gives m_h² ≈ 125² GeV².
const e = Electroweak.standard;
final m2 = e.higgsMass2(0.129);
print('m_h² = ${m2.toStringAsFixed(1)} GeV² (125² = ${125 * 125})');
}m_h² = 15613.1 GeV² (125² = 15625)