Multipole#

Utilities for multipoes.

BaseAtomicMultipole#

BaseAtomicMultipoleSet manages a set of atomic multipoles for lm, jm, cubic, and hexagonal basis.

class BaseAtomicMultipoleSet(b_type)[source]#

Bases: dict

initialize the class.

Parameters:

b_type (str) -- basis type, (lm/jm/cubic/hexagonal).

tag#

basis type, (lm/jm/cubic/hexagonal).

utility#

This file provides utility functions for atomic orbital.

basis_type(orb_list, crystal)[source]#

identify the type of basis.

Parameters:
  • orb_list (str/[str]) -- orbital list.

  • crystal (str) -- seven crystal systems, triclinic/monoclinic/orthorhombic/tetragonal/trigonal/hexagonal/cubic.

Returns:

type of basis (jm/lm/cubic/hexagonal).

Return type:

(tuple/NoneType)

invalid_f_orb_list(orb_list, crystal)[source]#

list of invalid f orbital list included in given orbital list.

Parameters:
  • orb_list (str/[str]) -- orbital list.

  • crystal (str) -- seven crystal systems, triclinic/monoclinic/orthorhombic/tetragonal/trigonal/hexagonal/cubic.

Returns:

invalid f orbital list.

Return type:

[str]

invalid_orb_list(orb_list)[source]#

list of orbital list with the invalid forms included in given orbital list.

Parameters:

orb_list (str/[str]) -- orbital list.

Returns:

invalid orbital list.

Return type:

[str]

is_insufficient(orb_list, crystal)[source]#

check if same irrep pair is not included in given orbital list.

Parameters:
  • orb_list (str/[str]) -- orbital list.

  • crystal (str) -- seven crystal systems, triclinic/monoclinic/orthorhombic/tetragonal/trigonal/hexagonal/cubic.

Returns:

same irrep pair is not included in given orbital list ?, orbit list that must be included at the same time.

Return type:

bool, str

is_spinful(orb_list)[source]#

spinful ?

Parameters:

orb_list (str/[str]) -- orbital.

Returns:

spinful ?

Return type:

bool

parse_orb_list(orb_list, spinful, crystal)[source]#

parse given orbital list. convert orbital list from an abbreviation form to a standard form.

Parameters:
  • orb_list (str/[str]) -- orbital list.

  • spinful (bool) -- spinful ?

  • crystal (str) -- seven crystal systems, triclinic/monoclinic/orthorhombic/tetragonal/trigonal/hexagonal/cubic.

Returns:

orbital list.

Return type:

([str])

rank(o, spinful, crystal)[source]#

rank of given orbital.

Parameters:
  • o (str) -- orbital.

  • spinful (bool) -- spinful ?

  • crystal (str) -- seven crystal systems, triclinic/monoclinic/orthorhombic/tetragonal/trigonal/hexagonal/cubic.

Returns:

rank.

Return type:

int

sort_orb_list(orb_list, spinful, crystal)[source]#

sort given orbital list.

Parameters:
  • orb_list (str/[str]) -- orbital list.

  • spinful (bool) -- spinful ?

  • crystal (str) -- seven crystal systems, triclinic/monoclinic/orthorhombic/tetragonal/trigonal/hexagonal/cubic.

Returns:

sorted orbital list.

["px", "py", "s"] => ["s", "px", "py"]

Return type:

([str])

split_orb_list_rank_block(orb_list, spinful, crystal)[source]#

split given orbital list into rank block.

Parameters:
  • orb_list (str/[str]) -- orbital list.

  • spinful (bool) -- spinful ?

  • crystal (str) -- seven crystal systems, triclinic/monoclinic/orthorhombic/tetragonal/trigonal/hexagonal/cubic.

Returns:

splitted orbital list.

["s","px","py"] => [["s"], ["px","py"]].

Return type:

[[str]]

to_latex(orb_list, spinful, crystal)[source]#

convert string to latex format.

Parameters:
  • orb_list (str/[str]) -- orbital list.

  • spinful (bool) -- spinful ?

  • crystal (str) -- seven crystal systems, triclinic/monoclinic/orthorhombic/tetragonal/trigonal/hexagonal/cubic.

Returns:

orbital in latex format.

Return type:

list

to_spinful(orb_list)[source]#

convert from spinless orbital list to spinful orbital list.

Parameters:

orb_list (str/[str]) -- orbital list.

Returns:

spinful orbital list.

Return type:

list

to_spinless(orb_list)[source]#

convert from spinful orbital list to spinless orbital list.

Parameters:

orb_list (str/[str]) -- orbital list.

Returns:

spinless orbital list.

Return type:

list

to_standard_form(orb_list, crystal)[source]#

convert from an abbreviation form to a standard form.

Parameters:
  • orb_list (str/[str]) -- orbital list.

  • b_type (str) -- type of basis, "lm/jm/cubic/hexagonal".

Returns:

orbital list in standard format.

Return type:

list

Note

ex) ["p"] -> ["px", "py", "pz"].

This file provides utility functions for calculation of atomic multipole basis set.

create_atomic_samb(bra_list, ket_list, spinful, crystal, bam, hs=None, u_matrix=None, ortho=True)[source]#

create atomic multipole basis set.

Parameters:
  • bra_list ([str]) -- orbital list of bra.

  • ket_list ([str]) -- orbital list of ket.

  • spinful (bool) -- spinful ?

  • crystal (str) -- seven crystal systems, triclinic/monoclinic/orthorhombic/tetragonal/trigonal/hexagonal/cubic.

  • bam (BaseAtomicMultipoleDataset) -- atomic-multipole dataset for all four basis.

  • hs (HarmonicsPG, optional) -- a set of point-group harmonics.

  • u_matrix (NSArray/[NSArray]) -- unitary transformation matrix from ket_list to arbitrary ket list.

  • ortho (bool, optional) -- orthogonalize ?

Returns:

atomic SAMB, {TagMultipole: NSArray(matrix)}.

Return type:

dict

This file provides utility functions for multipole basis set.

dict_to_matrix(shape, elements)[source]#

convert dict to full matrix.

Parameters:
  • shape (tuple) -- matrix shape.

  • elements (list) -- matrix elements, [(i,j,v)].

Returns:

full matrix.

Return type:

NSArray

matrix_sum(ml)[source]#

sum of matrices.

Parameters:

ml (list) -- matrix [Matrix].

Returns:

sum of matrices

Return type:

Matrix

matrix_to_dict(m)[source]#

convert matrix to list of matrix elements.

Parameters:

m (Matrix) -- matrix.

Returns:

tuple of matrix shape and elements, (shape, [(i,j,v)]).

Return type:

tuple

This file provides Pauli matices.

pauli_matrix(i=4, matrix=True)[source]#

Pauli matrices (σ0, σx, σy, σz)

Parameters:
  • i (int, optional) -- = 0(0), 1(x), 2(y), 3(z), other(all)

  • matrix (bool, optional) -- Matrix ?

Returns:

matrix or symbol or dict { str: Matrix }

Return type:

Matrix or sympy or dict

pauli_matrix_n(s, n, s1, s2)[source]#

Pauli matrices (σ00, σ11, σ10, σ1-1)

Parameters:
  • s (int) -- 0/1

  • n (int) -- 0/+1/-1

  • s1 (sympy) -- ±1/2

  • s2 (sympy) -- ±1/2

Returns:

matrix element

Return type:

sympy

This file provides basis list of spin-orbital space.

This file provides utility functions for calculation of structure multipole basis set.

cs_list(s, real=False)[source]#

list of c### and s### contained in the given equation.

Parameters:
  • s (str/Symbol) -- string object to be converted to symbol.

  • real (bool) -- real symbol ? If real=True, the object is recognized as a real number.

Returns:

[c###/s###]

Return type:

list

decompose_fk(fk, k_samb_set)[source]#

decompose k function into linear combination of structure multipoles.

Parameters:
  • fk (str/Symbol) -- function of k.

  • k_samb_set (list) -- [ ("kmp_#", "formfactor") ].

Returns:

dictionary of expansion coefficient {"smp_#": coeff}.

Return type:

dict

inner_product(f1, f2)[source]#

inner product of two structure factors.

Parameters:
  • f1 (str/Symbol) -- F1.

  • f2 (str/Symbol) -- F2.

Returns:

inner product of F1 and F2.

Return type:

NSArray

Notes

  • F1 and F2 are polynomials in terms of c### and s### (### are given by lst) only without const. terms.

normalize_fk(fk)[source]#

normalize k function.

Parameters:

fk (str/Symbol) -- function of k.

Returns:

normalized k function.

Return type:

Symbol

orthogonalize_fk(v, nmax=None)[source]#

orthogonalize list of function of k by Gram-Schmidt orthogonalization method.

Parameters:
  • v (NSArray) -- list of function of k to be orthogonalized.

  • nmax (int, optional) -- max. number of nonzero basis.

Returns:

orthogonalized list of function of k.

Return type:

NSArray

to_symbol(s, real=False)[source]#

convert string to symbol.

Parameters:
  • s (str) -- string object to be converted to symbol.

  • real (bool) -- real symbol ? If real=True, the object is recognized as a real number.

Returns:

symbol.

Return type:

Symbol

This file provides utility functions for combined multipole set.

create_z_samb(cg, hs, tag1_list, tag2_list, toroidal_priority=False, **kwargs)[source]#

initialize combined multipoles.

Parameters:
  • cg (clebsch_gordan_pg) -- Clebsh-Gordan coefficients.

  • hs (HarmonicsPG) -- the class to manage harmonics.

  • tag1_list (TagList) -- multipole/harmonics tag list.

  • tag2_list (TagList) -- multipole/harmonics tag list.

  • toroidal_priority (bool) -- create toroidal multipoles (G,T) in priority? else prioritize conventional multipoles (Q,M).

  • kwargs (dict, optional) -- select conditions for multipoles, keywords in ["head", "rank", "irrep", "mul", "comp", "s", "k"].

Returns:

{TagMultipole: [(coefficient, TagMultipole(atomic), TagMultipole(site/bond)] }.

Return type:

dict