torchspin.lft.tanabe_sugano#

Tanabe-Sugano: cubic d^n levels and diagrams, differentiable (Telser’s DTANSUG via telser-tools).

Two independent routes to the levels of d^n (n = 1 … 9) in an octahedral (Oh) or tetrahedral (Td) field, both linear in (B, C, Dq) over fixed matrices:

  • Strong-field blocks (DTANSUG.F; McClure 1959, Griffith 1964 Table A.27): every (2S+1)Gamma block in the t2^a e^b basis, with DTANSUG’s hole-problem signs (SIGNXF, SIGNEL) and the DIAG offset of d6-d8. The NumPy tables (torchspin.lft._engines.tanabe_sugano) are probed once at the unit vectors and checked for linearity, so H = B M_B + C M_C + Dq M_Dq with constant matrices. The Racah A term is left out (add n(n-1)/2 A), and for d9 also the constant -56B + 28C, as in DTANSUG.

  • Full determinant basis: spectrum(), all C(10, n) states from torchspin.lft.ddn (Racah A, B, C plus the Ballhausen cubic field; Td reverses the field).

Dq > 0 is the physical sign for both geometries (Oh: e above t2; Td: e below t2). Blocks are named by their (2S+1)Gamma label, e.g. '4T1'; blocks_for(n) lists them and get_block(n, label) returns one (Block, from the NumPy tables).

Units#

B, C, Dq, A and every returned energy are in units (default 'MHz'; 'cm^-1', 'GHz', 'K', 'eV'). The block matrices are homogeneous of degree one in (B, C, Dq), so the strong-field route needs no conversion; units is still checked and recorded. The diagram uses the conventional reduced axes, E/B (relative to the ground state) against Dq/B at fixed C/B, which carry no unit; pass B to tanabe_sugano() (or use TanabeSuganoDiagram.at()) for absolute energies and Dq in units.

Derivatives: energies through torchspin.lft._linalg.eigvalsh_gauge (a degenerate eigenvalue gets its level’s mean derivative, exact for the symmetry-protected degeneracies of the full determinant spectrum). weights (abs(c_ij)**2) depend on the basis inside a degenerate level and are differentiable only where the state is non-degenerate within its block. The order of all_levels() and the diagram’s ground curve are decided on detached values.

Not ported: the DTANSUG text report, the Fortran grid rules (fortran_grid: overshooting and always-ascending ranges, telser-tools findings 4-5) and the Fortran B-loop sign bug (finding 1; scan_b() uses the correct sign, as the telser-tools NumPy port does). Plots are in torchspin.lft.plot.

Examples

Cr(III), d3, in cm^-1: the 4T2 block lies 10 Dq above 4A2 (the Racah A term and constants are left out of the blocks).

>>> from torchspin.lft import tanabe_sugano as ts
>>> kw = dict(B=766.0, C=2855.0, Dq=1200.0, units="cm^-1")
>>> d10 = ts.block_energies(3, "4T2", **kw) - ts.block_energies(3, "4A2", **kw)
>>> round(float(d10[0]), 6)
12000.0
>>> [round(e, 1) for e in ts.block_energies(3, "4T1", **kw).tolist()]
[-7402.5, 3112.5]

The d5 diagram at C/B = 4.5: high spin (6A1) changes to low spin (2T2) at Dq/B = 2.84.

>>> d = ts.tanabe_sugano(5, c_over_b=4.5)                     # E/B vs Dq/B
>>> d.e_over_b.shape, d.ground[0], d.ground[-1], [round(x, 2) for x in d.crossover()]
(torch.Size([43, 201]), '6A1', '2T2', [2.84])
>>> d.at(B=800.0, units="cm^-1").energy.shape                # absolute, cm^-1
torch.Size([43, 201])
class torchspin.lft.tanabe_sugano.Block(nh, first, label, terms, configs, fortran_line)[source]#

One (2S+1)Gamma block of the d^n (n <= 5 electrons or holes) problem.

Variables:
  • nh (number of d electrons (n <= 5) or holes (10 - n) the block refers to.)

  • first (Fortran index (NGRP) of the first strong-field configuration;) – the menu number NFIG of DTANSUG.F selects the block containing it.

  • label (e.g. "3T1" (multiplicity, irrep).)

  • terms (free-ion terms the block correlates with (DTANSUG.F CONTITL).)

  • configs (strong-field configurations with their B/C = 0.2 free-ion) – parentage (DTANSUG.F CONFIG; obvious typos corrected, see docs/tanabe_sugano.md).

  • fortran_line (line of the block's definition in DTANSUG.F.)

property degeneracy: int[source]#

Spin x orbital degeneracy (2S+1) dim(Gamma) of each level.

class torchspin.lft.tanabe_sugano.BlockSolution(n, geometry, block, B, C, Dq, matrix, energies, zeroth_order, vectors, weights, units)[source]#

One block of d^n diagonalized at (B, C, Dq) (solve_block()).

Variables:
  • n (int) – Number of d electrons.

  • geometry (str) – 'Oh' or 'Td'.

  • block (Block) – The block.

  • Dq (B, C,) – The parameters, in units.

  • matrix (Tensor, shape (..., nb, nb)) – The block Hamiltonian.

  • energies (Tensor, shape (..., nb)) – Ascending eigenvalues.

  • zeroth_order (Tensor, shape (..., nb)) – Diagonal of matrix (strong-field configuration energies).

  • vectors (Tensor, shape (..., nb, nb)) – Eigenvectors as columns.

  • weights (Tensor, shape (..., nb, nb)) – weights[..., i, j] = abs(<config j|state i>)**2.

  • units (str) – Energy unit.

n: int#

Alias for field number 0

geometry: str#

Alias for field number 1

block: Block#

Alias for field number 2

B: Tensor#

Alias for field number 3

C: Tensor#

Alias for field number 4

Dq: Tensor#

Alias for field number 5

matrix: Tensor#

Alias for field number 6

energies: Tensor#

Alias for field number 7

zeroth_order: Tensor#

Alias for field number 8

vectors: Tensor#

Alias for field number 9

weights: Tensor#

Alias for field number 10

units: str#

Alias for field number 11

class torchspin.lft.tanabe_sugano.CubicLevel(label, energy, degeneracy, root)[source]#

One level of d^n (all_levels()).

Variables:
  • label (str) – (2S+1)Gamma block label.

  • energy (Tensor) – Energy in the units asked for.

  • degeneracy (int) – (2S+1) dim(Gamma).

  • root (int) – 0-based index within its block.

label: str#

Alias for field number 0

energy: Tensor#

Alias for field number 1

degeneracy: int#

Alias for field number 2

root: int#

Alias for field number 3

class torchspin.lft.tanabe_sugano.Scan(n, geometry, block, variable, B, C, Dq, energies, zeroth_order, weights, units)[source]#

One block along a line of Dq (fixed B, C) or of B (fixed Dq, C/B) (scan_dq(), scan_b()).

Variables:
n: int#

Alias for field number 0

geometry: str#

Alias for field number 1

block: Block#

Alias for field number 2

variable: str#

Alias for field number 3

B: Tensor#

Alias for field number 4

C: Tensor#

Alias for field number 5

Dq: Tensor#

Alias for field number 6

energies: Tensor#

Alias for field number 7

zeroth_order: Tensor#

Alias for field number 8

weights: Tensor#

Alias for field number 9

units: str#

Alias for field number 10

property x: Tensor[source]#

Dq or B, shape (npts,).

Type:

The scanned values

class torchspin.lft.tanabe_sugano.TanabeSuganoDiagram(n, geometry, c_over_b, dq_over_b, labels, degeneracies, e_over_b, ground, B=None, units='MHz')[source]#

Tanabe-Sugano diagram data of d^n at fixed C/B (tanabe_sugano()).

Variables:
  • n (int) – Number of d electrons.

  • geometry (str) – 'Oh' or 'Td'.

  • c_over_b (Tensor) – C/B.

  • dq_over_b (Tensor, shape (npts,)) – The abscissa Dq/B.

  • labels (tuple of (str, int)) – labels[i] = (block label, root) of curve i, e.g. ('4T1', 1).

  • degeneracies (tuple of int) – (2S+1) dim(Gamma) of each curve.

  • e_over_b (Tensor, shape (ncurves, npts)) – E/B relative to the ground state at each point.

  • ground (tuple of str) – Ground block at each point.

  • B (Tensor or None) – Racah B in units; turns on the absolute axes energy and dq.

  • units (str) – Unit of B.

n: int#

Alias for field number 0

geometry: str#

Alias for field number 1

c_over_b: Tensor#

Alias for field number 2

dq_over_b: Tensor#

Alias for field number 3

labels: tuple[tuple[str, int], ...]#

Alias for field number 4

degeneracies: tuple[int, ...]#

Alias for field number 5

e_over_b: Tensor#

Alias for field number 6

ground: tuple[str, ...]#

Alias for field number 7

B: Tensor | None#

Alias for field number 8

units: str#

Alias for field number 9

property energy: Tensor | None[source]#

Energies above the ground state in units (E/B times B), shape (ncurves, npts); None without B.

property dq: Tensor | None[source]#

Dq in units (Dq/B times B), shape (npts,); None without B.

at(B, units=None)[source]#

The same diagram with Racah B given in units (default: the diagram’s units).

to(units)[source]#

Convert B (and so energy, dq) to units; the reduced axes are unchanged.

curve(label, root=0)[source]#

E/B of one curve, e.g. curve('4T2') or curve('4T1', 1).

Raises KeyError if there is no such (label, root).

crossover()[source]#

Dq/B values (list of float, linear interpolation on detached values) where the ground state changes.

torchspin.lft.tanabe_sugano.all_levels(n, B, C, Dq, geometry='Oh', units='MHz')[source]#

Every level of d^n (all blocks), ascending.

B, C, Dq are scalars in units; the order is decided on detached energies. Returns a list of CubicLevel (energies without the Racah A term).

torchspin.lft.tanabe_sugano.block_energies(n, label, B, C, Dq, geometry='Oh', units='MHz')[source]#

Ascending eigenvalues of one strong-field block.

Arguments as block_hamiltonian(). Returns a tensor of shape (…, nb) in units (without the Racah A term).

torchspin.lft.tanabe_sugano.block_hamiltonian(n, label, B, C, Dq, geometry='Oh', units='MHz')[source]#

Real symmetric strong-field block of d^n.

Parameters:
  • n (int) – Number of d electrons, 1 … 9.

  • label (str or Block) – Block label such as '4T1'.

  • B (float or Tensor) – Racah parameters and cubic field in units; broadcast against each other.

  • C (float or Tensor) – Racah parameters and cubic field in units; broadcast against each other.

  • Dq (float or Tensor) – Racah parameters and cubic field in units; broadcast against each other.

  • geometry ({'Oh', 'Td'}, default 'Oh') – Coordination geometry.

  • units (str, default 'MHz') – Energy unit of the inputs and the result (checked; the blocks are homogeneous).

Returns:

torch.Tensor, shape (…, nb, nb), float64 – In units, without the Racah A term.

Return type:

Tensor

torchspin.lft.tanabe_sugano.block_operators(n, label, geometry='Oh', device='cpu')[source]#

Constant matrices of one strong-field block: H = B M[0] + C M[1] + Dq M[2].

Parameters:
  • n (int) – Number of d electrons, 1 … 9.

  • label (str or Block) – Block label such as '4T1'.

  • geometry ({'Oh', 'Td'}, default 'Oh') – Coordination geometry.

  • device (str or device, default 'cpu') – Device of the result.

Returns:

torch.Tensor, shape (3, nb, nb), float64 – Unit-free; configurations in Block.configs order.

Raises:

ValueError – If the block does not belong to d^n, or for an unknown geometry or label.

Return type:

Tensor

torchspin.lft.tanabe_sugano.blocks_for(n)[source]#

All blocks of d^n, in DTANSUG.F menu order (equal for d^n and d^(10-n)).

torchspin.lft.tanabe_sugano.get_block(n, label)[source]#

Block of d^n by its label, e.g. get_block(3, "4T2").

torchspin.lft.tanabe_sugano.scan_b(n, label, Dq, b_values, c_over_b, geometry='Oh', units='MHz')[source]#

One block of d^n over a range of Racah B with C = (C/B) B at fixed Dq.

Dq and b_values (1-D) are in units; c_over_b is dimensionless. The cubic-field sign is that of the Dq loop (DTANSUG.F’s B loop omits SIGNXF: telser-tools finding 1). Returns a Scan.

Raises:

ValueError – If c_over_b <= 0 (DTANSUG.F silently substitutes 5).

torchspin.lft.tanabe_sugano.scan_dq(n, label, B, C, dq_values, geometry='Oh', units='MHz')[source]#

One block of d^n over a range of Dq at fixed B and C.

B, C and dq_values (1-D) are in units and may carry gradients; other arguments as block_hamiltonian(). Returns a Scan.

torchspin.lft.tanabe_sugano.solve_block(n, label, B, C, Dq, geometry='Oh', units='MHz')[source]#

Diagonalize one block of d^n.

Arguments as block_hamiltonian() (batched over B, C, Dq, all in units). Returns a BlockSolution.

torchspin.lft.tanabe_sugano.spectrum(n, B, C, Dq, geometry='Oh', A=0.0, units='MHz')[source]#

All C(10, n) eigenvalues of d^n in a cubic field (determinant basis, torchspin.lft.ddn).

Parameters:
  • n (int) – Number of d electrons, 1 … 9.

  • B (float or Tensor) – Racah parameters and cubic field in units; Dq > 0 is physical for both geometries.

  • C (float or Tensor) – Racah parameters and cubic field in units; Dq > 0 is physical for both geometries.

  • Dq (float or Tensor) – Racah parameters and cubic field in units; Dq > 0 is physical for both geometries.

  • geometry ({'Oh', 'Td'}, default 'Oh') – Coordination geometry.

  • A (float or Tensor, default 0.0) – Racah A in units.

  • units (str, default 'MHz') – Energy unit of the inputs and the result.

Returns:

torch.Tensor, shape (…, C(10, n)), float64 – Ascending, including n(n-1)/2 A and, unlike the blocks, the full repulsion energy for every n.

Return type:

Tensor

torchspin.lft.tanabe_sugano.tanabe_sugano(n, c_over_b=4.5, dq_over_b=None, geometry='Oh', *, B=None, units='MHz')[source]#

Tanabe-Sugano diagram: E/B relative to the ground state vs Dq/B at fixed C/B.

Parameters:
  • n (int) – Number of d electrons, 2 … 8.

  • c_over_b (float or Tensor, default 4.5) – C/B (> 0).

  • dq_over_b (array_like or Tensor, optional) – Abscissa Dq/B; default 0 … 4 in 201 points.

  • geometry ({'Oh', 'Td'}, default 'Oh') – Coordination geometry.

  • B (float or Tensor, optional) – Racah B in units; adds the absolute axes .energy and .dq (differentiable in B).

  • units (str, default 'MHz') – Unit of B.

Returns:

TanabeSuganoDiagram – E/B depends only on Dq/B and C/B (the blocks are linear in B, C, Dq), so B = 1 internally; the result is differentiable in c_over_b and dq_over_b. The ground curve at each point is chosen on detached values; E/B then follows that curve.

Raises:

ValueError – For n = 1 or 9 (no electron repulsion, so no diagram), an invalid n or geometry, or a non-positive or non-finite c_over_b.

Return type:

TanabeSuganoDiagram