|
OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
|
Unit tests for the Thomas-BMT spin pusher (Rodrigues-rotation kernel). More...
#include <gtest/gtest.h>#include "Physics/Physics.h"#include "Steppers/SpinTBMTPusher.h"#include "Utility/Inform.h"#include <cmath>
Go to the source code of this file.
Classes | |
| class | SpinTBMTPusherTest |
Functions | |
| TEST_F (SpinTBMTPusherTest, PrecessesAtCorrectFrequencyInStaticBz) | |
| TEST_F (SpinTBMTPusherTest, NoEvolutionWhenPolParallelToBAndNoE) | |
| TEST_F (SpinTBMTPusherTest, NoEvolutionWhenFieldsAreZero) | |
| TEST_F (SpinTBMTPusherTest, PreservesMagnitudeOverManySteps) | |
Variables | |
| Inform * | gmsg |
Unit tests for the Thomas-BMT spin pusher (Rodrigues-rotation kernel).
The SpinTBMTPusher evolves the per-particle polarization vector \(\vec P\) over a timestep \(\Delta t\) by the Thomas-BMT equation \(d\vec P / dt = \vec\Omega \times \vec P\), with the lab-frame angular velocity
\[ \vec\Omega = -\frac{q}{m}\Big[\, \big(G + \frac{1}{\gamma}\big)\,\vec B - \frac{G\,\gamma}{\gamma+1}\,(\vec\beta \cdot \vec B)\,\vec\beta - \big(G + \frac{1}{\gamma+1}\big)\,\frac{\vec\beta \times \vec E}{c} \,\Big], \]
applied as an analytic rotation by angle \(\phi = |\vec\Omega|\,\Delta t\) about \(\hat n = \vec\Omega / |\vec\Omega|\) via Rodrigues' formula. The rotation form preserves \(|\vec P|\) exactly per step.
Here \(G = (g - 2) / 2\) is the magnetic moment anomaly: the dimensionless deviation of the particle's gyromagnetic ratio \(g\) from the Dirac value \(g = 2\). For the muon, \(G = a_\mu \approx 1.166 \times 10^{-3}\); for the proton, \(G \approx 1.793\). \(G = 0\) recovers pure Larmor precession at \(\omega = qB/(\gamma m)\), so the contribution \(G\,\vec B\) in \(\vec\Omega\) is precisely the part the BMT equation adds beyond the Dirac result.
References:
The cyclotron-frequency reference used in the precession check is \(\omega_c = q\,c^2\,B / (\gamma\,m_{\text{eV}})\), which in OPALX conventions equals the SI \(qB/(\gamma m)\) because mass is stored as rest energy \(m c^2\) in eV.
Tests in this file:
Definition in file TestSpinTBMTPusher.cpp.
| TEST_F | ( | SpinTBMTPusherTest | , |
| NoEvolutionWhenFieldsAreZero | |||
| ) |
Definition at line 153 of file TestSpinTBMTPusher.cpp.
References SpinTBMTPusher::evolve().

| TEST_F | ( | SpinTBMTPusherTest | , |
| NoEvolutionWhenPolParallelToBAndNoE | |||
| ) |
Definition at line 136 of file TestSpinTBMTPusher.cpp.
References SpinTBMTPusher::evolve().

| TEST_F | ( | SpinTBMTPusherTest | , |
| PrecessesAtCorrectFrequencyInStaticBz | |||
| ) |
Definition at line 104 of file TestSpinTBMTPusher.cpp.
References SpinTBMTPusher::evolve().

| TEST_F | ( | SpinTBMTPusherTest | , |
| PreservesMagnitudeOverManySteps | |||
| ) |
Definition at line 169 of file TestSpinTBMTPusher.cpp.
References SpinTBMTPusher::evolve().

|
extern |
Definition at line 7 of file changes.cpp.
Referenced by SpinTBMTPusherTest::SetUpTestSuite(), and SpinTBMTPusherTest::TearDownTestSuite().