Clarification of theta/phi definitions for CMC anisotropy

10 views
Skip to first unread message

Tong Zhao

unread,
Aug 22, 2025, 3:14:10 AMAug 22
to Vampire Users
Hi,
I’m using the constrained Monte Carlo (cmc-anisotropy) program to evaluate temperature‑dependent anisotropy in 2D materials. I’m unsure about the exact definitions of the constraint angles:
Is theta (θ) the azimuthal angle in the xy plane from +x, and phi (φ) the polar angle from +z?

My current input (from the workshop example) is:
#------------------------------------------
# Simulation attributes:
#------------------------------------------
######################################
sim:minimum-temperature = 0
sim:maximum-temperature = 2000
sim:temperature-increment = 100
######################################

sim:equilibration-time-steps = 5000
sim:loop-time-steps = 5000

sim:constraint-angle-theta-minimum=0.0
sim:constraint-angle-theta-maximum=0.0
sim:constraint-angle-theta-increment=10.0
sim:constraint-angle-phi-minimum=0.0
sim:constraint-angle-phi-maximum=90.0
sim:constraint-angle-phi-increment=15.0

sim:save-checkpoint=continuous
sim:save-checkpoint-rate=1
#sim:load-checkpoint=continue
#------------------------------------------
# Program and integrator details
#------------------------------------------
sim:integrator = constrained-monte-carlo
sim:program = cmc-anisotropy
#------------------------------------------
# data output
#------------------------------------------
output:temperature
output:constraint-theta
output:constraint-phi
output:mean-magnetisation-length
output:mean-total-torque
output:anisotropy-energy
output:mean-anisotropy-energy

My understanding from the manual is that constraint-phi is measured from the z‑axis and constraint-theta from the x‑axis (i.e., φ polar, θ azimuth). Thus, fixing θ=0° and sweeping φ=0→90° would tilt M from +z to +x. Could someone please confirm that this is the correct interpretation for cmc-anisotropy?

Any pointers would be greatly appreciated. Thanks in advance!

gabo...@gmail.com

unread,
Aug 22, 2025, 10:11:49 AMAug 22
to Vampire Users
If it helps, do you have "Initialising spins to new constraint direction (phi, theta)" in your log file?

If so, when I ran the input and uni.mat from [1], I noticed it outputted that in the log file as shown below:

username@computername:~$ mkdir cmc-anisotropy
username@computername:~$ cd cmc-anisotropy/
username@computername:~/cmc-anisotropy$ wget https://github.com/richard-evans/vampire-workshop/raw/refs/heads/master/input-files/2_constrained_montecarlo_and_dipole_fields/2a_uniaxial/input
...
username@computername:~/cmc-anisotropy$ wget https://github.com/richard-evans/vampire-workshop/raw/refs/heads/master/input-files/2_constrained_montecarlo_and_dipole_fields/2a_uniaxial/uni.mat
...
username@computername:~/cmc-anisotropy$ vampire-serial
                                                _          
                                               (_)        
                    __   ____ _ _ __ ___  _ __  _ _ __ ___
                    \ \ / / _` | '_ ` _ \| '_ \| | '__/ _ \
                     \ V / (_| | | | | | | |_) | | | |  __/
                      \_/ \__,_|_| |_| |_| .__/|_|_|  \___|
                                         | |              
                                         |_|              

                      Version 7.0.0 Aug  4 2025 22:39:21

             Git commit: 525bc27ee44c525aee229570f30f3d4c61d54f66

  Licensed under the GNU Public License(v2). See licence file for details.

  Developers:   Richard F L Evans, Sarah Jenkins, Andrea Meo,
                Daniel Meilak, Andrew Naden, Matthew Ellis,
                Oscar Arbelaez, Sam Morris, Rory Pond, Weijia Fan,
                Phanwadee Chureemart, Pawel Sobieszczyk, Joe Barker,
                Thomas Ostler, Andreas Biternas, Roy W Chantrell,
                Wu Hong-Ye, Razvan Ababei, Sam Westmoreland,
                Milton Persson
 
                Compiler Flags:

  Vampire includes a copy of the qhull library from C.B. Barber and The
  Geometry Center and may be obtained via http from www.qhull.org.

================================================================================
Fri Aug 22 05:56:27 2025
================================================================================
Initialising system variables
Creating system
Generating neighbour list..........done!
Copying system data to optimised data structures.
Using generic/normalised form of exchange interaction with 16 total interactions.
Number of atoms generated: 6750
Starting Simulation with Program CMC-Anisotropy...
Simulation run time [s]: 1897.09
Constrained Monte Carlo statistics:
Total moves: 9.9225e+09
47.6124% Accepted
37.1643% Rejected (Energy)
15.2233% Rejected (Sphere)
Simulation ended gracefully.
username@computername:~/cmc-anisotropy$ grep constraint log
22-08-2025 [05:56:27] Initialising spins to new constraint direction (phi, theta) 0 , 0
22-08-2025 [06:00:58] Initialising spins to new constraint direction (phi, theta) 15 , 0
22-08-2025 [06:05:29] Initialising spins to new constraint direction (phi, theta) 30 , 0
22-08-2025 [06:10:01] Initialising spins to new constraint direction (phi, theta) 45 , 0
22-08-2025 [06:14:32] Initialising spins to new constraint direction (phi, theta) 60 , 0
22-08-2025 [06:19:02] Initialising spins to new constraint direction (phi, theta) 75 , 0
22-08-2025 [06:23:33] Initialising spins to new constraint direction (phi, theta) 90 , 0

I found in the source code (cmc.cpp [2]), the lines:

// Output message showing constraint direction re-initialisation
zlog << zTs() << "Initialising spins to new constraint direction (phi, theta) " <<  sim::constraint_phi << " , " << sim::constraint_theta << std::endl;

// Initialise all spins along the constraint direction.
double sx=sin(sim::constraint_phi*M_PI/180.0)*cos(sim::constraint_theta*M_PI/180.0);
double sy=sin(sim::constraint_phi*M_PI/180.0)*sin(sim::constraint_theta*M_PI/180.0);
double sz=cos(sim::constraint_phi*M_PI/180.0);

The above source code lines look like the spherical coordinate equations at [3] but with ρ = 1.

Using a few different values for the equations:

For φ = 0 degrees and θ = 0 degrees,

Sx = sin(φ*π/180)*cos(θ*π/180) = sin(0*π/180)*cos(0*π/180) = 0
Sy = sin(φ*π/180)*sin(θ*π/180) = sin(0*π/180)*sin(0*π/180) = 0
Sz = cos(φ*π/180) = cos(0*π/180) = 1

For the equations, I found on a webpage at [4] that ρ = 1 (or  r = 1) can be selected.  However, since it hard to see with ρ = 1, ρ = 4 was selected:
phi0.png

For φ = 45 degrees and θ = 0 degrees,

Sx = sin(φ*π/180)*cos(θ*π/180) = sin(45*π/180)*cos(0*π/180) = 0.707
Sy = sin(φ*π/180)*sin(θ*π/180) = sin(45*π/180)*sin(0*π/180) = 0
Sz = cos(φ*π/180) = cos(45*π/180) = 0.707

phi45.png

For φ = 90 degrees and θ = 0 degrees,

Sx = sin(φ*π/180)*cos(θ*π/180) = sin(90*π/180)*cos(0*π/180) = 1
Sy = sin(φ*π/180)*sin(θ*π/180) = sin(90*π/180)*sin(0*π/180) = 0
Sz = cos(φ*π/180) = cos(90*π/180) = 0

phi90.png


Gavin
VAMPIRE user
Reply all
Reply to author
Forward
0 new messages