moyoc
C interface of moyo, a fast and robust crystal symmetry finder
Loading...
Searching...
No Matches
moyoc.h File Reference
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
Include dependency graph for moyoc.h:

Go to the source code of this file.

Data Structures

struct  MoyoSpaceGroupType
 Space-group type information, created by moyo_space_group_type_new and freed by moyo_space_group_type_free. More...
struct  MoyoLayerGroupType
 Layer-group type information, created by moyo_layer_group_type_new and freed by moyo_layer_group_type_free. More...
struct  MoyoHallSymbolEntry
 An entry containing space-group information for a specified Hall number, created by moyo_hall_symbol_entry_new and freed by moyo_hall_symbol_entry_free. More...
struct  MoyoLayerHallSymbolEntry
 An entry containing layer-group information for a specified layer Hall number, created by moyo_layer_hall_symbol_entry_new and freed by moyo_layer_hall_symbol_entry_free. More...
struct  MoyoMagneticSpaceGroupType
 Magnetic space-group type information, created by moyo_magnetic_space_group_type_new and freed by moyo_magnetic_space_group_type_free. More...
struct  MoyoOperations
 Symmetry operations. More...
struct  MoyoMagneticOperations
 Magnetic symmetry operations. More...
struct  MoyoCell
 Crystal structure. More...
struct  MoyoLayerDataset
 A dataset of the layer-group symmetry analysis, created by moyo_layer_dataset_new and freed by moyo_layer_dataset_free. More...
struct  MoyoCollinearMagneticCell
 Collinear magnetic structure. More...
struct  MoyoCollinearMagneticDataset
 A dataset of the magnetic symmetry analysis of a collinear magnetic structure, created by moyo_collinear_magnetic_dataset_new and freed by moyo_collinear_magnetic_dataset_free. More...
struct  MoyoNonCollinearMagneticCell
 Non-collinear magnetic structure. More...
struct  MoyoNonCollinearMagneticDataset
 A dataset of the magnetic symmetry analysis of a non-collinear magnetic structure, created by moyo_noncollinear_magnetic_dataset_new and freed by moyo_noncollinear_magnetic_dataset_free. More...
struct  MoyoDataset
 A dataset of the symmetry analysis, created by moyo_dataset_new and freed by moyo_dataset_free. More...
struct  MoyoLayerGroup
 Layer group identified by moyo_layer_group_new and freed by moyo_layer_group_free. More...
struct  MoyoMagneticSpaceGroup
 Magnetic space group identified by moyo_magnetic_space_group_new and freed by moyo_magnetic_space_group_free. More...
struct  MoyoPointGroup
 Point group identified by moyo_point_group_new and freed by moyo_point_group_free. More...
struct  MoyoSpaceGroup
 Space group identified by moyo_space_group_new and freed by moyo_space_group_free. More...

Typedefs

typedef int32_t MoyoSetting
typedef int32_t MoyoLayerSetting

Enumerations

enum  MoyoSetting { MOYO_SETTING_HALL_NUMBER , MOYO_SETTING_SPGLIB , MOYO_SETTING_STANDARD }
 Preference for the setting of the space group. More...
enum  MoyoLayerSetting { MOYO_LAYER_SETTING_HALL_NUMBER , MOYO_LAYER_SETTING_SPGLIB , MOYO_LAYER_SETTING_STANDARD }
 Preference for the Hall setting of the layer group. More...

Functions

const char * moyo_version (void)
 Return the version string of moyoc (e.g.
struct MoyoSpaceGroupType * moyo_space_group_type_new (int32_t number)
 Look up the space-group type information for ITA number (1 - 230).
void moyo_space_group_type_free (struct MoyoSpaceGroupType *space_group_type)
 Free a space-group type created by moyo_space_group_type_new.
struct MoyoLayerGroupType * moyo_layer_group_type_new (int32_t number)
 Look up the layer-group type information for layer-group number (1 - 80).
void moyo_layer_group_type_free (struct MoyoLayerGroupType *layer_group_type)
 Free a layer-group type created by moyo_layer_group_type_new.
struct MoyoHallSymbolEntry * moyo_hall_symbol_entry_new (int32_t hall_number)
 Look up the space-group Hall symbol entry for hall_number (1 - 530).
void moyo_hall_symbol_entry_free (struct MoyoHallSymbolEntry *entry)
 Free an entry created by moyo_hall_symbol_entry_new.
struct MoyoLayerHallSymbolEntry * moyo_layer_hall_symbol_entry_new (int32_t hall_number)
 Look up the layer-group Hall symbol entry for hall_number (1 - 116).
void moyo_layer_hall_symbol_entry_free (struct MoyoLayerHallSymbolEntry *entry)
 Free an entry created by moyo_layer_hall_symbol_entry_new.
struct MoyoMagneticSpaceGroupType * moyo_magnetic_space_group_type_new (int32_t uni_number)
 Look up the magnetic space-group type information for uni_number (1 - 1651).
void moyo_magnetic_space_group_type_free (struct MoyoMagneticSpaceGroupType *magnetic_space_group_type)
 Free a magnetic space-group type created by moyo_magnetic_space_group_type_new.
struct MoyoOperations * moyo_operations_from_number (int32_t number, MoyoSetting setting, int32_t hall_number, bool primitive)
 Return symmetry operations for the given space-group ITA number (1 - 230).
struct MoyoOperations * moyo_operations_from_layer_number (int32_t number, MoyoLayerSetting setting, int32_t hall_number, bool primitive)
 Return symmetry operations for the given layer-group number (1 - 80).
void moyo_operations_free (struct MoyoOperations *operations)
 Free operations returned by moyo_operations_from_number or moyo_operations_from_layer_number.
struct MoyoMagneticOperations * moyo_magnetic_operations_from_uni_number (int32_t uni_number, bool primitive)
 Return magnetic symmetry operations for the given UNI (and BNS) serial number uni_number (1 - 1651).
void moyo_magnetic_operations_free (struct MoyoMagneticOperations *magnetic_operations)
 Free magnetic operations returned by moyo_magnetic_operations_from_uni_number.
struct MoyoLayerDataset * moyo_layer_dataset_new (const double(*basis)[3], const double(*positions)[3], const int32_t *numbers, int32_t num_atoms, double symprec, double angle_tolerance, MoyoLayerSetting setting, int32_t hall_number, bool rotate_basis)
 Analyze the layer-group symmetry of the given cell and create a dataset.
void moyo_layer_dataset_free (struct MoyoLayerDataset *dataset)
 Free a dataset created by moyo_layer_dataset_new.
struct MoyoCollinearMagneticDataset * moyo_collinear_magnetic_dataset_new (const double(*basis)[3], const double(*positions)[3], const int32_t *numbers, const double *magnetic_moments, int32_t num_atoms, double symprec, double angle_tolerance, double mag_symprec, bool is_axial, bool rotate_basis)
 Analyze the magnetic symmetry of the given collinear magnetic cell and create a dataset.
void moyo_collinear_magnetic_dataset_free (struct MoyoCollinearMagneticDataset *dataset)
 Free a dataset created by moyo_collinear_magnetic_dataset_new.
struct MoyoNonCollinearMagneticDataset * moyo_noncollinear_magnetic_dataset_new (const double(*basis)[3], const double(*positions)[3], const int32_t *numbers, const double(*magnetic_moments)[3], int32_t num_atoms, double symprec, double angle_tolerance, double mag_symprec, bool is_axial, bool rotate_basis)
 Analyze the magnetic symmetry of the given non-collinear magnetic cell and create a dataset.
void moyo_noncollinear_magnetic_dataset_free (struct MoyoNonCollinearMagneticDataset *dataset)
 Free a dataset created by moyo_noncollinear_magnetic_dataset_new.
struct MoyoDataset * moyo_dataset_new (const double(*basis)[3], const double(*positions)[3], const int32_t *numbers, int32_t num_atoms, double symprec, double angle_tolerance, MoyoSetting setting, int32_t hall_number, bool rotate_basis)
 Analyze the symmetry of the given cell and create a dataset.
void moyo_dataset_free (struct MoyoDataset *dataset)
 Free a dataset created by moyo_dataset_new.
struct MoyoLayerGroup * moyo_layer_group_new (const int32_t(*prim_rotations)[3][3], const double(*prim_translations)[3], int32_t num_operations, const double(*basis)[3], MoyoLayerSetting setting, int32_t hall_number, double epsilon)
 Identify the layer group from primitive layer-cell rotations and translations.
void moyo_layer_group_free (struct MoyoLayerGroup *layer_group)
 Free a layer group created by moyo_layer_group_new.
struct MoyoMagneticSpaceGroup * moyo_magnetic_space_group_new (const int32_t(*prim_rotations)[3][3], const double(*prim_translations)[3], const bool *prim_time_reversals, int32_t num_operations, const double(*basis)[3], double epsilon)
 Identify the magnetic space group from primitive magnetic operations.
void moyo_magnetic_space_group_free (struct MoyoMagneticSpaceGroup *magnetic_space_group)
 Free a magnetic space group created by moyo_magnetic_space_group_new.
struct MoyoPointGroup * moyo_point_group_new (const int32_t(*prim_rotations)[3][3], int32_t num_operations, const double(*basis)[3])
 Identify the point group of the given primitive rotations.
void moyo_point_group_free (struct MoyoPointGroup *point_group)
 Free a point group created by moyo_point_group_new.
struct MoyoSpaceGroup * moyo_space_group_new (const int32_t(*prim_rotations)[3][3], const double(*prim_translations)[3], int32_t num_operations, const double(*basis)[3], MoyoSetting setting, int32_t hall_number, double epsilon)
 Identify the space group from primitive rotations and translations.
void moyo_space_group_free (struct MoyoSpaceGroup *space_group)
 Free a space group created by moyo_space_group_new.

Typedef Documentation

◆ MoyoLayerSetting

typedef int32_t MoyoLayerSetting

◆ MoyoSetting

typedef int32_t MoyoSetting

Enumeration Type Documentation

◆ MoyoLayerSetting

Preference for the Hall setting of the layer group.

Enumerator
MOYO_LAYER_SETTING_HALL_NUMBER 

Layer Hall number specified by the hall_number argument (1 - 116).

MOYO_LAYER_SETTING_SPGLIB 

The setting of the smallest layer Hall number for each layer group (origin choice 1 for the centrosymmetric layer groups 52, 62, 64).

MOYO_LAYER_SETTING_STANDARD 

BCS standard choice (de la Flor et al., Acta Cryst.

A77, 559-571 (2021)): origin choice 2 for the centrosymmetric layer groups 52, 62, 64

◆ MoyoSetting

Preference for the setting of the space group.

Enumerator
MOYO_SETTING_HALL_NUMBER 

Hall number specified by the hall_number argument.

MOYO_SETTING_SPGLIB 

The setting of the smallest Hall number.

MOYO_SETTING_STANDARD 

Unique axis b, cell choice 1 for monoclinic, hexagonal axes for rhombohedral, and origin choice 2 for centrosymmetric space groups.

Function Documentation

◆ moyo_collinear_magnetic_dataset_free()

void moyo_collinear_magnetic_dataset_free ( struct MoyoCollinearMagneticDataset * dataset)

Free a dataset created by moyo_collinear_magnetic_dataset_new.

Passing NULL is a no-op.

Safety

dataset must be a pointer returned by moyo_collinear_magnetic_dataset_new that has not been freed yet, or NULL.

◆ moyo_collinear_magnetic_dataset_new()

struct MoyoCollinearMagneticDataset * moyo_collinear_magnetic_dataset_new ( const double(*) basis[3],
const double(*) positions[3],
const int32_t * numbers,
const double * magnetic_moments,
int32_t num_atoms,
double symprec,
double angle_tolerance,
double mag_symprec,
bool is_axial,
bool rotate_basis )

Analyze the magnetic symmetry of the given collinear magnetic cell and create a dataset.

  • basis: row-wise basis vectors, basis[i] is the ith basis vector.
  • positions: fractional coordinates of the num_atoms sites.
  • numbers: atomic numbers of the num_atoms sites.
  • magnetic_moments: collinear magnetic moments of the num_atoms sites.
  • angle_tolerance: tolerance of angle between basis vectors in radians. Pass a negative value to use the default angle tolerance.
  • mag_symprec: tolerance for matching magnetic moments. Pass a negative value to reuse symprec.
  • is_axial: whether magnetic moments transform as axial vectors.
  • Returns NULL if the symmetry search fails or the arguments are invalid.

Safety

basis must point to 3 basis vectors, and positions, numbers, and magnetic_moments must point to num_atoms elements each.

◆ moyo_dataset_free()

void moyo_dataset_free ( struct MoyoDataset * dataset)

Free a dataset created by moyo_dataset_new.

Passing NULL is a no-op.

Safety

dataset must be a pointer returned by moyo_dataset_new that has not been freed yet, or NULL.

◆ moyo_dataset_new()

struct MoyoDataset * moyo_dataset_new ( const double(*) basis[3],
const double(*) positions[3],
const int32_t * numbers,
int32_t num_atoms,
double symprec,
double angle_tolerance,
MoyoSetting setting,
int32_t hall_number,
bool rotate_basis )

Analyze the symmetry of the given cell and create a dataset.

  • basis: row-wise basis vectors, basis[i] is the ith basis vector.
  • positions: fractional coordinates of the num_atoms sites.
  • numbers: atomic numbers of the num_atoms sites.
  • angle_tolerance: tolerance of angle between basis vectors in radians. Pass a negative value to use the default angle tolerance.
  • hall_number: preference for Hall symbol, only used with MOYO_SETTING_HALL_NUMBER.
  • Returns NULL if the symmetry search fails or the arguments are invalid.

Safety

basis must point to 3 basis vectors, and positions and numbers must point to num_atoms elements each.

◆ moyo_hall_symbol_entry_free()

void moyo_hall_symbol_entry_free ( struct MoyoHallSymbolEntry * entry)

Free an entry created by moyo_hall_symbol_entry_new.

Passing NULL is a no-op.

Safety

entry must be a pointer returned by moyo_hall_symbol_entry_new that has not been freed yet, or NULL.

◆ moyo_hall_symbol_entry_new()

struct MoyoHallSymbolEntry * moyo_hall_symbol_entry_new ( int32_t hall_number)

Look up the space-group Hall symbol entry for hall_number (1 - 530).

Returns NULL if hall_number is out of range.

◆ moyo_layer_dataset_free()

void moyo_layer_dataset_free ( struct MoyoLayerDataset * dataset)

Free a dataset created by moyo_layer_dataset_new.

Passing NULL is a no-op.

Safety

dataset must be a pointer returned by moyo_layer_dataset_new that has not been freed yet, or NULL.

◆ moyo_layer_dataset_new()

struct MoyoLayerDataset * moyo_layer_dataset_new ( const double(*) basis[3],
const double(*) positions[3],
const int32_t * numbers,
int32_t num_atoms,
double symprec,
double angle_tolerance,
MoyoLayerSetting setting,
int32_t hall_number,
bool rotate_basis )

Analyze the layer-group symmetry of the given cell and create a dataset.

  • basis: row-wise basis vectors, basis[i] is the ith basis vector. The third basis vector must be the aperiodic stacking direction, perpendicular to the first two, which must lie in the xy-plane.
  • positions: fractional coordinates of the num_atoms sites.
  • numbers: atomic numbers of the num_atoms sites.
  • angle_tolerance: tolerance of angle between basis vectors in radians. Pass a negative value to use the default angle tolerance.
  • hall_number: preference for layer Hall symbol, only used with MOYO_LAYER_SETTING_HALL_NUMBER.
  • Returns NULL if the symmetry search fails or the arguments are invalid.

Safety

basis must point to 3 basis vectors, and positions and numbers must point to num_atoms elements each.

◆ moyo_layer_group_free()

void moyo_layer_group_free ( struct MoyoLayerGroup * layer_group)

Free a layer group created by moyo_layer_group_new.

Passing NULL is a no-op.

Safety

layer_group must be a pointer returned by moyo_layer_group_new that has not been freed yet, or NULL.

◆ moyo_layer_group_new()

struct MoyoLayerGroup * moyo_layer_group_new ( const int32_t(*) prim_rotations[3][3],
const double(*) prim_translations[3],
int32_t num_operations,
const double(*) basis[3],
MoyoLayerSetting setting,
int32_t hall_number,
double epsilon )

Identify the layer group from primitive layer-cell rotations and translations.

  • prim_rotations, prim_translations: rotation and translation parts of the num_operations layer-group operations in the primitive layer cell.
  • basis: row-wise basis vectors of the primitive layer lattice, basis[i] is the ith basis vector. a, b must lie in the xy-plane and c along z (the layer-group periodicity contract). Pass NULL to assume an identity basis.
  • hall_number: preference for layer Hall symbol, only used with MOYO_LAYER_SETTING_HALL_NUMBER.
  • epsilon: numerical tolerance for matching translations. Pass a negative value to use the default tolerance (1e-4).
  • Returns NULL if the identification fails or the arguments are invalid. Free the result with moyo_layer_group_free.

Safety

prim_rotations and prim_translations must point to num_operations elements each, and basis must point to 3 basis vectors or be NULL.

◆ moyo_layer_group_type_free()

void moyo_layer_group_type_free ( struct MoyoLayerGroupType * layer_group_type)

Free a layer-group type created by moyo_layer_group_type_new.

Passing NULL is a no-op.

Safety

layer_group_type must be a pointer returned by moyo_layer_group_type_new that has not been freed yet, or NULL.

◆ moyo_layer_group_type_new()

struct MoyoLayerGroupType * moyo_layer_group_type_new ( int32_t number)

Look up the layer-group type information for layer-group number (1 - 80).

Returns NULL if number is out of range.

◆ moyo_layer_hall_symbol_entry_free()

void moyo_layer_hall_symbol_entry_free ( struct MoyoLayerHallSymbolEntry * entry)

Free an entry created by moyo_layer_hall_symbol_entry_new.

Passing NULL is a no-op.

Safety

entry must be a pointer returned by moyo_layer_hall_symbol_entry_new that has not been freed yet, or NULL.

◆ moyo_layer_hall_symbol_entry_new()

struct MoyoLayerHallSymbolEntry * moyo_layer_hall_symbol_entry_new ( int32_t hall_number)

Look up the layer-group Hall symbol entry for hall_number (1 - 116).

Returns NULL if hall_number is out of range.

◆ moyo_magnetic_operations_free()

void moyo_magnetic_operations_free ( struct MoyoMagneticOperations * magnetic_operations)

Free magnetic operations returned by moyo_magnetic_operations_from_uni_number.

Passing NULL is a no-op. Do not call this on magnetic operations embedded in a dataset; those are freed by the dataset's free function.

Safety

magnetic_operations must be a pointer returned by moyo_magnetic_operations_from_uni_number that has not been freed yet, or NULL.

◆ moyo_magnetic_operations_from_uni_number()

struct MoyoMagneticOperations * moyo_magnetic_operations_from_uni_number ( int32_t uni_number,
bool primitive )

Return magnetic symmetry operations for the given UNI (and BNS) serial number uni_number (1 - 1651).

  • primitive: if true, return magnetic operations of the primitive cell; otherwise return operations of the conventional cell.
  • Returns NULL if the arguments are invalid. Free the returned operations with moyo_magnetic_operations_free.

◆ moyo_magnetic_space_group_free()

void moyo_magnetic_space_group_free ( struct MoyoMagneticSpaceGroup * magnetic_space_group)

Free a magnetic space group created by moyo_magnetic_space_group_new.

Passing NULL is a no-op.

Safety

magnetic_space_group must be a pointer returned by moyo_magnetic_space_group_new that has not been freed yet, or NULL.

◆ moyo_magnetic_space_group_new()

struct MoyoMagneticSpaceGroup * moyo_magnetic_space_group_new ( const int32_t(*) prim_rotations[3][3],
const double(*) prim_translations[3],
const bool * prim_time_reversals,
int32_t num_operations,
const double(*) basis[3],
double epsilon )

Identify the magnetic space group from primitive magnetic operations.

  • prim_rotations, prim_translations, prim_time_reversals: rotation, translation, and time-reversal parts of the num_operations magnetic operations in the primitive cell.
  • basis: row-wise basis vectors of the primitive lattice, basis[i] is the ith basis vector. Pass NULL to assume an identity basis.
  • epsilon: numerical tolerance for matching translations. Pass a negative value to use the default tolerance (1e-4).
  • Returns NULL if the identification fails or the arguments are invalid. Free the result with moyo_magnetic_space_group_free.

Safety

prim_rotations, prim_translations, and prim_time_reversals must point to num_operations elements each, and basis must point to 3 basis vectors or be NULL.

◆ moyo_magnetic_space_group_type_free()

void moyo_magnetic_space_group_type_free ( struct MoyoMagneticSpaceGroupType * magnetic_space_group_type)

Free a magnetic space-group type created by moyo_magnetic_space_group_type_new.

Passing NULL is a no-op.

Safety

magnetic_space_group_type must be a pointer returned by moyo_magnetic_space_group_type_new that has not been freed yet, or NULL.

◆ moyo_magnetic_space_group_type_new()

struct MoyoMagneticSpaceGroupType * moyo_magnetic_space_group_type_new ( int32_t uni_number)

Look up the magnetic space-group type information for uni_number (1 - 1651).

Returns NULL if uni_number is out of range.

◆ moyo_noncollinear_magnetic_dataset_free()

void moyo_noncollinear_magnetic_dataset_free ( struct MoyoNonCollinearMagneticDataset * dataset)

Free a dataset created by moyo_noncollinear_magnetic_dataset_new.

Passing NULL is a no-op.

Safety

dataset must be a pointer returned by moyo_noncollinear_magnetic_dataset_new that has not been freed yet, or NULL.

◆ moyo_noncollinear_magnetic_dataset_new()

struct MoyoNonCollinearMagneticDataset * moyo_noncollinear_magnetic_dataset_new ( const double(*) basis[3],
const double(*) positions[3],
const int32_t * numbers,
const double(*) magnetic_moments[3],
int32_t num_atoms,
double symprec,
double angle_tolerance,
double mag_symprec,
bool is_axial,
bool rotate_basis )

Analyze the magnetic symmetry of the given non-collinear magnetic cell and create a dataset.

  • basis: row-wise basis vectors, basis[i] is the ith basis vector.
  • positions: fractional coordinates of the num_atoms sites.
  • numbers: atomic numbers of the num_atoms sites.
  • magnetic_moments: non-collinear magnetic moments of the num_atoms sites in Cartesian coordinates.
  • angle_tolerance: tolerance of angle between basis vectors in radians. Pass a negative value to use the default angle tolerance.
  • mag_symprec: tolerance for matching magnetic moments. Pass a negative value to reuse symprec.
  • is_axial: whether magnetic moments transform as axial vectors.
  • Returns NULL if the symmetry search fails or the arguments are invalid.

Safety

basis must point to 3 basis vectors, and positions, numbers, and magnetic_moments must point to num_atoms elements each.

◆ moyo_operations_free()

void moyo_operations_free ( struct MoyoOperations * operations)

Free operations returned by moyo_operations_from_number or moyo_operations_from_layer_number.

Passing NULL is a no-op. Do not call this on operations embedded in a dataset; those are freed by the dataset's free function.

Safety

operations must be a pointer returned by moyo_operations_from_number or moyo_operations_from_layer_number that has not been freed yet, or NULL.

◆ moyo_operations_from_layer_number()

struct MoyoOperations * moyo_operations_from_layer_number ( int32_t number,
MoyoLayerSetting setting,
int32_t hall_number,
bool primitive )

Return symmetry operations for the given layer-group number (1 - 80).

  • hall_number: preference for layer Hall symbol, only used with MOYO_LAYER_SETTING_HALL_NUMBER (number is ignored in that case).
  • primitive: if true, return operations of the primitive cell; otherwise return operations of the conventional cell.
  • Returns NULL if the arguments are invalid. Free the returned operations with moyo_operations_free.

◆ moyo_operations_from_number()

struct MoyoOperations * moyo_operations_from_number ( int32_t number,
MoyoSetting setting,
int32_t hall_number,
bool primitive )

Return symmetry operations for the given space-group ITA number (1 - 230).

  • hall_number: preference for Hall symbol, only used with MOYO_SETTING_HALL_NUMBER (number is ignored in that case).
  • primitive: if true, return operations of the primitive cell; otherwise return operations of the conventional cell.
  • Returns NULL if the arguments are invalid. Free the returned operations with moyo_operations_free.

◆ moyo_point_group_free()

void moyo_point_group_free ( struct MoyoPointGroup * point_group)

Free a point group created by moyo_point_group_new.

Passing NULL is a no-op.

Safety

point_group must be a pointer returned by moyo_point_group_new that has not been freed yet, or NULL.

◆ moyo_point_group_new()

struct MoyoPointGroup * moyo_point_group_new ( const int32_t(*) prim_rotations[3][3],
int32_t num_operations,
const double(*) basis[3] )

Identify the point group of the given primitive rotations.

  • prim_rotations: rotation matrices of the num_operations operations in the primitive cell.
  • basis: row-wise basis vectors of the primitive lattice, basis[i] is the ith basis vector. Pass NULL to assume an identity basis.
  • Returns NULL if the identification fails or the arguments are invalid. Free the result with moyo_point_group_free.

Safety

prim_rotations must point to num_operations elements, and basis must point to 3 basis vectors or be NULL.

◆ moyo_space_group_free()

void moyo_space_group_free ( struct MoyoSpaceGroup * space_group)

Free a space group created by moyo_space_group_new.

Passing NULL is a no-op.

Safety

space_group must be a pointer returned by moyo_space_group_new that has not been freed yet, or NULL.

◆ moyo_space_group_new()

struct MoyoSpaceGroup * moyo_space_group_new ( const int32_t(*) prim_rotations[3][3],
const double(*) prim_translations[3],
int32_t num_operations,
const double(*) basis[3],
MoyoSetting setting,
int32_t hall_number,
double epsilon )

Identify the space group from primitive rotations and translations.

  • prim_rotations, prim_translations: rotation and translation parts of the num_operations operations in the primitive cell.
  • basis: row-wise basis vectors of the primitive lattice, basis[i] is the ith basis vector. Pass NULL to assume an identity basis.
  • hall_number: preference for Hall symbol, only used with MOYO_SETTING_HALL_NUMBER.
  • epsilon: numerical tolerance for matching translations. Pass a negative value to use the default tolerance (1e-4).
  • Returns NULL if the identification fails or the arguments are invalid. Free the result with moyo_space_group_free.

Safety

prim_rotations and prim_translations must point to num_operations elements each, and basis must point to 3 basis vectors or be NULL.

◆ moyo_space_group_type_free()

void moyo_space_group_type_free ( struct MoyoSpaceGroupType * space_group_type)

Free a space-group type created by moyo_space_group_type_new.

Passing NULL is a no-op.

Safety

space_group_type must be a pointer returned by moyo_space_group_type_new that has not been freed yet, or NULL.

◆ moyo_space_group_type_new()

struct MoyoSpaceGroupType * moyo_space_group_type_new ( int32_t number)

Look up the space-group type information for ITA number (1 - 230).

Returns NULL if number is out of range.

◆ moyo_version()

const char * moyo_version ( void )

Return the version string of moyoc (e.g.

"0.11.0"). The returned string is statically allocated and must not be freed.