torchspin 0.6.6__tar.gz → 0.6.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. {torchspin-0.6.6 → torchspin-0.6.7}/CHANGELOG.md +20 -0
  2. {torchspin-0.6.6 → torchspin-0.6.7}/CITATION.cff +1 -1
  3. {torchspin-0.6.6 → torchspin-0.6.7}/PKG-INFO +1 -1
  4. {torchspin-0.6.6 → torchspin-0.6.7}/pyproject.toml +1 -1
  5. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/__init__.py +1 -1
  6. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/ham.py +12 -6
  7. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/hamsymm.py +1 -3
  8. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/spinsystem.py +1 -1
  9. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin.egg-info/PKG-INFO +1 -1
  10. {torchspin-0.6.6 → torchspin-0.6.7}/LICENSE.md +0 -0
  11. {torchspin-0.6.6 → torchspin-0.6.7}/MANIFEST.in +0 -0
  12. {torchspin-0.6.6 → torchspin-0.6.7}/README.md +0 -0
  13. {torchspin-0.6.6 → torchspin-0.6.7}/setup.cfg +0 -0
  14. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/_cardamom_istos.py +0 -0
  15. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/_cardamom_propagatedm.py +0 -0
  16. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/_cardamom_utils.py +0 -0
  17. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/_compile.py +0 -0
  18. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/_linalg.py +0 -0
  19. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/_omp.py +0 -0
  20. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/_resources.py +0 -0
  21. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/_rng.py +0 -0
  22. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/angmom.py +0 -0
  23. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/autograd.py +0 -0
  24. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/autoguess.py +0 -0
  25. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/batch.py +0 -0
  26. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/blochsteady.py +0 -0
  27. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/cardamom.py +0 -0
  28. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/chili.py +0 -0
  29. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/chili_sle.py +0 -0
  30. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/constants.py +0 -0
  31. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/convspec.py +0 -0
  32. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/ctafft.py +0 -0
  33. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/curry.py +0 -0
  34. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/data/FourierSeriesCoefficients.txt +0 -0
  35. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/data/GaussianCascadeCoefficients.txt +0 -0
  36. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/data/isotopedata.txt +0 -0
  37. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/data/spacegroups.txt +0 -0
  38. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/dataproc.py +0 -0
  39. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/dipbackground.py +0 -0
  40. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/dipkernel.py +0 -0
  41. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/diptensor.py +0 -0
  42. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/endorfrq.py +0 -0
  43. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/endorfrq_perturb.py +0 -0
  44. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/eprload.py +0 -0
  45. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/eprsave.py +0 -0
  46. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/esfit.py +0 -0
  47. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/evolve.py +0 -0
  48. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/ewrls.py +0 -0
  49. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/excitation.py +0 -0
  50. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/exciteprofile.py +0 -0
  51. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/experiment.py +0 -0
  52. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/exponfit.py +0 -0
  53. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/fastmotion.py +0 -0
  54. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/fdaxis.py +0 -0
  55. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/fitgui.py +0 -0
  56. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/garlic.py +0 -0
  57. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/gridcheck.py +0 -0
  58. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/ham_cf.py +0 -0
  59. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/ham_ee.py +0 -0
  60. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/ham_ez.py +0 -0
  61. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/ham_ezho.py +0 -0
  62. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/ham_hf.py +0 -0
  63. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/ham_nn.py +0 -0
  64. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/ham_nq.py +0 -0
  65. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/ham_nz.py +0 -0
  66. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/ham_oz.py +0 -0
  67. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/ham_so.py +0 -0
  68. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/ham_zf.py +0 -0
  69. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/initstate.py +0 -0
  70. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/isotopologues.py +0 -0
  71. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/levels.py +0 -0
  72. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/levelsplot.py +0 -0
  73. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/lineshape.py +0 -0
  74. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/lpsvd.py +0 -0
  75. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/makespec.py +0 -0
  76. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/mdhmm.py +0 -0
  77. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/mdload.py +0 -0
  78. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/mdtraj2oripot.py +0 -0
  79. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/ml.py +0 -0
  80. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/mlpsvd.py +0 -0
  81. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/nucdata.py +0 -0
  82. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/nucfrq2d.py +0 -0
  83. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/orca2torchspin.py +0 -0
  84. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/ordering.py +0 -0
  85. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/oripotentialplot.py +0 -0
  86. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/orisel.py +0 -0
  87. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/pepper.py +0 -0
  88. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/pepper_autograd.py +0 -0
  89. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/photoselect.py +0 -0
  90. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/plegendre.py +0 -0
  91. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/propint.py +0 -0
  92. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/pulse.py +0 -0
  93. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/py.typed +0 -0
  94. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/rapidscan2spc.py +0 -0
  95. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/resfields.py +0 -0
  96. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/resfields_batch.py +0 -0
  97. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/resfields_eig.py +0 -0
  98. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/resfields_hybrid.py +0 -0
  99. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/resfields_perturb.py +0 -0
  100. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/resfreqs_matrix.py +0 -0
  101. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/resfreqs_perturb.py +0 -0
  102. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/resonator.py +0 -0
  103. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/resonatorprofile.py +0 -0
  104. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/rfmixer.py +0 -0
  105. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/rotations.py +0 -0
  106. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/rotutils.py +0 -0
  107. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/saffron.py +0 -0
  108. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/saffron_pathways.py +0 -0
  109. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/saffron_peaks.py +0 -0
  110. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/saffron_thyme.py +0 -0
  111. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/salt.py +0 -0
  112. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/sigeq.py +0 -0
  113. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/signalprocessing.py +0 -0
  114. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/sitetransforms.py +0 -0
  115. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/sphgrid.py +0 -0
  116. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/spidyan.py +0 -0
  117. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/spinladder.py +0 -0
  118. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/spinops.py +0 -0
  119. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/stackplot.py +0 -0
  120. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/stev.py +0 -0
  121. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/stochtraj_diffusion.py +0 -0
  122. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/stochtraj_jump.py +0 -0
  123. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/strainwidth.py +0 -0
  124. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/transmitter.py +0 -0
  125. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin/utils.py +0 -0
  126. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin.egg-info/SOURCES.txt +0 -0
  127. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin.egg-info/dependency_links.txt +0 -0
  128. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin.egg-info/requires.txt +0 -0
  129. {torchspin-0.6.6 → torchspin-0.6.7}/torchspin.egg-info/top_level.txt +0 -0
@@ -6,6 +6,26 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.6.7] — 2026-11-09
10
+
11
+ ### Fixed
12
+
13
+ - **Linear higher-order Zeeman terms (`Sys.Ham1xx`) had opposite signs in
14
+ `ham(Sys)` and `ham(Sys, B0)`** (all public releases, 0.3.0–0.6.6). The moment operators of `ham(Sys)` carried
15
+ +dH/dB, but torchspin's convention is H = H0 − μ·B, so the field-free
16
+ decomposition (used by pepper's resonance search, `levels`, `endorfrq`,
17
+ `salt`, `curry`, `nucfrq2d`) had these terms with the opposite sign to
18
+ `ham(Sys, B0)` and to the nuclear Zeeman interaction. Without nuclei this
19
+ does not change spectra (time reversal); with nuclei it changed ENDOR and
20
+ nuclear frequencies and forbidden-transition intensities. EasySpin's
21
+ `ham.m` has the same inconsistency; torchspin now deliberately deviates
22
+ from it (see KNOWN_LIMITATIONS.md, "Higher-order Zeeman terms").
23
+ - `hamsymm` added the higher-order Zeeman Hamiltonian twice when probing for
24
+ symmetry (`ham(Sys, B0)` already includes it).
25
+ - `SpinSystem(g=[2.0])` (a one-element list, which EasySpin treats like
26
+ `g=2`) crashed `ham` with an IndexError; it now means isotropic g, like a
27
+ scalar.
28
+
9
29
  ## [0.6.6] — 2026-11-09
10
30
 
11
31
  ### Fixed
@@ -2,7 +2,7 @@ cff-version: 1.2.0
2
2
  message: "If you use torchspin in your research, please cite both torchspin and the upstream EasySpin paper."
3
3
  title: "torchspin: Differentiable PyTorch port of EasySpin for EPR spectroscopy"
4
4
  type: software
5
- version: "0.6.6"
5
+ version: "0.6.7"
6
6
  date-released: "2026-11-09"
7
7
  license: MIT
8
8
  authors:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: torchspin
3
- Version: 0.6.6
3
+ Version: 0.6.7
4
4
  Summary: Differentiable PyTorch port of EasySpin - EPR/ESR spin Hamiltonian and spectrum simulation
5
5
  Author-email: Alec Follmer <ahfollmer@ucdavis.edu>
6
6
  Maintainer-email: Alec Follmer <ahfollmer@ucdavis.edu>
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "torchspin"
7
- version = "0.6.6"
7
+ version = "0.6.7"
8
8
  description = "Differentiable PyTorch port of EasySpin - EPR/ESR spin Hamiltonian and spectrum simulation"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -25,7 +25,7 @@ try:
25
25
  __version__ = _pkg_version("torchspin")
26
26
  except _PkgNotFound:
27
27
  # Editable install during development, or version metadata unavailable.
28
- __version__ = "0.6.6+dev"
28
+ __version__ = "0.6.7+dev"
29
29
 
30
30
  # Idle OpenMP threads must sleep, not spin-wait (see torchspin/_omp.py and
31
31
  # docs/pitfalls.md, "Threads and performance"). This has to run before anything
@@ -115,9 +115,15 @@ def ham(
115
115
  muy = muy + muy_oz
116
116
  muz = muz + muz_oz
117
117
 
118
- # Higher-order Zeeman terms (Sys.Ham*): EasySpin ham.m adds the zero-field
119
- # part to H0 and the linear-in-B part to the moment operators; at a given
120
- # field the complete ham_ezho(Sys,B0) is added instead.
118
+ # Higher-order Zeeman terms (Sys.Ham*): the zero-field part goes into H0 and
119
+ # the linear-in-B part into the moment operators; at a given field the
120
+ # complete ham_ezho(Sys,B0) is added instead. ham_ezho's G1 is dH/dB, and
121
+ # H = H0 - mu.B, so the linear part enters the moments as -G1. EasySpin's
122
+ # ham.m adds +G1, which flips the sign of these terms relative to
123
+ # ham(Sys,B0) and to every other Zeeman term; torchspin deliberately does
124
+ # not follow it (KNOWN_LIMITATIONS.md, "Higher-order Zeeman terms").
125
+ # Quadratic and cubic terms (G2, G3) are not representable as H0 - mu.B and
126
+ # are included only by ham(Sys, B0).
121
127
  ho_zeeman = sys.Ham is not None and any(
122
128
  bool(torch.any(v != 0)) for v in sys.Ham.values()
123
129
  )
@@ -127,9 +133,9 @@ def ham(
127
133
  from torchspin.ham_ezho import ham_ezho
128
134
  G0, G1, _, _ = ham_ezho(sys, B0=None, dtype=dtype, device=device)
129
135
  H0 = H0 + G0
130
- mux = mux + G1[0]
131
- muy = muy + G1[1]
132
- muz = muz + G1[2]
136
+ mux = mux - G1[0]
137
+ muy = muy - G1[1]
138
+ muz = muz - G1[2]
133
139
  return H0, mux, muy, muz
134
140
 
135
141
  # Full Hamiltonian
@@ -275,11 +275,9 @@ def _hamsymm_eigs(
275
275
  FieldVecs = _probe_field_vectors()
276
276
 
277
277
  if higher_zeeman:
278
- from torchspin.ham_ezho import ham_ezho
279
-
280
278
  def eig_at(Bvec: torch.Tensor) -> torch.Tensor:
281
279
  B = Bvec.tolist()
282
- H = ham(sys, B0=B) + ham_ezho(sys, B0=B)
280
+ H = ham(sys, B0=B) # already includes ham_ezho(sys, B0=B)
283
281
  return torch.linalg.eigvalsh(H)
284
282
  else:
285
283
  H0, mux, muy, muz = ham(sys)
@@ -295,7 +295,7 @@ class SpinSystem:
295
295
  # Scalar: isotropic g for all electrons
296
296
  self.g = self.g.expand(n_e, 3).clone()
297
297
  elif self.g.ndim == 1:
298
- if n_e > 1 and self.g.shape[0] == n_e:
298
+ if self.g.shape[0] == n_e:
299
299
  # [g1, g2, ...]: one isotropic g per electron (EasySpin column form)
300
300
  self.g = self.g.unsqueeze(1).expand(n_e, 3).clone()
301
301
  elif self.g.shape[0] == 3:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: torchspin
3
- Version: 0.6.6
3
+ Version: 0.6.7
4
4
  Summary: Differentiable PyTorch port of EasySpin - EPR/ESR spin Hamiltonian and spectrum simulation
5
5
  Author-email: Alec Follmer <ahfollmer@ucdavis.edu>
6
6
  Maintainer-email: Alec Follmer <ahfollmer@ucdavis.edu>
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes