PAOFLOW.pyskeaf.geometry#
Geometry helpers — reciprocal-lattice volumes and field-direction setup.
Mirrors the Fortran utility code in skeaf_v1p3p0_r149.F90:
unit_cell_volumereproduces theunitcellvolume = |det(plr)|computation at line 1056.set_field_anglereproduces the subroutinepsetangle(lines 3071–3129), which converts anhvdselector (‘a’, ‘b’, ‘c’, ‘n’, ‘r’) into spherical angles (theta, phi) of the magnetic field axis.
Conventions#
All angles are in radians (the Fortran stores degrees in user input and converts to radians internally; we standardise on radians).
recipis a (3, 3) array withrecip[i]the i-th reciprocal lattice vector in Cartesian Å^-1 with the 2π factor (i.e. theplr*form).The H-vector spherical convention matches Fortran
psetangle:theta = atan2(v_y, v_x) # azimuth in xy-plane phi = acos(v_z / \(|v|\)) # polar angle from +z
Attributes#
Functions#
|
Return the BZ (reciprocal unit cell) volume |
|
Compute the (theta, phi) of the magnetic-field axis from an |
|
Return the three reciprocal-lattice vector lengths |
|
Return the inter-axis angles |
Module Contents#
- PAOFLOW.pyskeaf.geometry.unit_cell_volume(recip)[source]#
Return the BZ (reciprocal unit cell) volume
|det(recip)|.- Parameters:
recip (ndarray, shape (3, 3)) – Reciprocal lattice vectors as rows (Å^-1, with 2π factor).
- PAOFLOW.pyskeaf.geometry.set_field_angle(recip, hvd, theta=0.0, phi=0.0)[source]#
Compute the (theta, phi) of the magnetic-field axis from an
hvdflag.Reproduces
psetangle(skeaf_v1p3p0_r149.F90 lines 3071–3129).- Parameters:
recip (ndarray, shape (3, 3)) – Reciprocal lattice vectors as rows (Å^-1, with 2π factor). Only used for
hvd in {'a', 'b', 'c'}.hvd ({'a', 'b', 'c', 'n', 'r'}) –
Field-direction selector:
'a','b','c'— align field with reciprocal vector 0, 1 or 2 respectively.'n'— return the user-suppliedtheta,phiunchanged (caller has already obtained them from input).'r'— auto-rotation; this routine returns(theta, phi)unchanged for the caller to set in a sweep.
theta (float, optional) – Used for
hvd in {'n', 'r'}; angles in radians.phi (float, optional) – Used for
hvd in {'n', 'r'}; angles in radians.
- Returns:
(theta_rad, phi_rad)
- Return type: