Material Model#
Dict data#
This class has the following dict data.
General info.
model (str): model name.
version (str): MultiPie version.
created (str): created time stamp.
Structural info.
group (str): group tag.
crystal (str): crystal class.
cell_info (dict): unit-cell information
cell (dict): unit-cell parameters.
a (float): a.
b (float): b.
c (float): c.
alpha (float): alpha (deg.).
beta (float): beta (deg.).
gamma (float): gamma (deg.).
volume (float): volume.
A (list): [a1,a2,a3,t] conventional lattice and translational vectors (4x4, each column).
G (list): metric matrix for conventional lattice (4x4).
unit_vector (list): unit vectors, a1, a2, a3 (conventional cell).
unit_vector_primitive (list): unit vectors, a1p, a2p, a3p (primitive cell), A_p = P^T A, consistent with the primitive fractional coordinates of the sites (x_c = P x_p). Models created before this was fixed store A Pi^T for centred lattices; ModelAnalyzer recomputes A_p from unit_vector.
Generation condition.
SAMB_select (dict): SAMB selection.
atomic_select (dict): atomic SAMB selection.
site_select (dict): site-cluster SAMB selection.
bond_select (dict): bond-cluster SAMB selection.
toroidal_priority (bool): toroidal priority, false=Q-G or true=G-Q.
Site and bond info.
site_grid (dict): site grid.
site (dict): site info.
representative (dict): representative site, dict[name, RepSiteType].
cell (dict): conventional cell site, dict[name, [CellSiteType]].
bond (dict): bond info.
representative (dict): representative bond, dict[name, RepBondType].
cell (dict): conventional cell bond, dict[name, [CellBondType]]. The head of a bond is at position_primitive of the head site in the home cell, and its tail at position_primitive of the tail site plus R_primitive, so that vector_primitive = head - (tail + R_primitive). In models created before PR #151, R_primitive is wrong by a primitive lattice vector for bonds of a centred lattice (I, F, C, A, R) whose head and tail sites need different shifts into [0,1) when converted to the primitive cell (P lattices are not affected). Loading such a model keeps the stored R_primitive, so the model and the files created from it (SAMB matrices, H®) must be created again.
info (list): bond properties, [BondInfoType].
SAMB.
SAMB_number (int): total number of SAMBs.
SAMB_number_min (int): total number of SAMBs excluding duplicated ones.
atomic_samb (dict): atomic SAMB, dict[BraketInfoType, SAMB Dict].
atomic_id (dict): atomic SAMB ID, dict[tag, (BraketInfoType, index, component)].
cluster_samb (dict): site/bond cluster SAMB, dict[wyckoff, SAMB Dict].
cluster_id (dict): site/bond cluster SAMB ID, dict[tag, (wyckoff, index, component)].
combined_samb (dict): combined SAMB, dict[SAMBType, SAMB Dict].
combined_id (dict): combined SAMB ID, dict[tag, (symbol, UniqueSAMBType, index, component)].
combined_cluster (dict): combined cluster info, dict[combined SAMB ID, site/bond_name].
irrep_id (dict): combined SAMB ID by irrep., dict[irrep, combined_id].
common_id (dict): common ID of combined SAMB, dict[SAMBType, ([Ztag_list], [site/bond-tag])].
cluster_info (dict): cluster info, dict[site/bond_name, dict[(bra_rank,ket_rank), (wyckoff,z_list)] ].
cluster_vector (dict): cluster vector info, dict[site/bond_name, [primitive_vector]].
Misc.
basis_type (str): atomic basis type.
full_matrix (dict): full matrix info.
ket (list): ket info., [(atom,sublattice,rank,basis_index,orbital)].
index (dict): index info., dict[(atom,SL,rank), (top,size)].
braket (dict): braket info., dict[site/bond-tag, [BraketInfoType]].
wyckoff (dict): wyckoff info., dict[site/bond-tag, wyckoff].
qtdraw_prop (dict): QtDraw properties.
pdf_ctrl (dict): PDF creation control.
SAMB Dict data#
Combined, atomic, and site/bond-cluster SAMBs have the following dict data.
Combined SAMB, \(Z_i\), Dict[index, SAMB].
index (PGMultipoleType): (X,l,\(\Gamma\),n,p,s,k,x)
SAMB (tuple): SAMB data for set of components.
(list) [[(coeff, X_index, X_component, Y_index, Y_component)]],
(list) [symmetry].
Atomic SAMB, \(X_j\), Dict[index, SAMB].
index (PGMultipoleType): (X,l,\(\Gamma\),n,p,s,k,x)
SAMB (tuple): SAMB data for set of components.
(list) [matrix],
(list) [symmetry]
Site/bond-cluster SAMB, \(Y_k\), Dict[index, SAMB].
index (PGMultipoleType): (X,l,\(\Gamma\),n,p,s,k,x)
SAMB (tuple): SAMB data for set of components.
(list) [vector],
(list) [symmetry]
MaterialModel Class#
Material model construction class.
This module provides material model construction.
- class MaterialModel(topdir=None, verbose=False)[source]#
Bases:
BinaryManagerMaterial model construction.
- Parameters:
topdir (str, optional) – top directory. [default: cwd]
verbose (bool, optional) – verbose comment ?
- X(tag, hc=False)[source]#
Get atomic SAMB.
- Parameters:
tag (str) – atomic tag, e.g. x1.
hc (bool, optional) – hermite conjugation ?
- Returns:
(ndarray) – atomic SAMB matrix.
(sympy) – symmetry.
- Y(tag)[source]#
Get site/bond-cluster SAMB.
- Parameters:
tag (str) – cluster tag, e.g., y1.
- Returns:
(ndarray) – cluster SAMB vector.
(sympy) – symmetry.
- Z(tag, symbol=False)[source]#
Get combined SAMB.
- Parameters:
tag (str) – combined tag, e.g., z1.
symbol (bool, optional) – symbol expression ?
- Returns:
(list or sympy) – combined SAMB linear combination list or expression.
(sympy) – symmetry.
(str or sympy) – symbol in LaTex or expression.
- analyze(model_in)[source]#
Set model.
- Parameters:
model_in (dict or str) – model input dict or file name.
- cell_site_primitive()[source]#
Get site position in primitive unit cell.
- Returns:
(dict) – site dict, dict[name, [position]].
- get_atomic_samb(select)[source]#
Get all atomic SAMB.
- Parameters:
select (dict) – select dict.
- Returns:
(dict) – atomic SAMB, dict[BraketInfoType, SAMB Dict].
(dict) – atomic id, dict[“x#”, (SAMB index, comp)].
- get_cluster_samb(site_select, bond_select)[source]#
Get all cluster SAMB.
- Parameters:
site_select (dict) – site select dict.
bond_select (dict) – bond select dict.
- Returns:
(dict) – cluster SAMB, dict[wyckoff, SAMB Dict].
(dict) – cluster id, dict[“y#”, (wyckoff, SAMB index, comp)].
- get_combined_samb(atomic_samb, cluster_samb, select, toroidal_priority=False)[source]#
Get all combined SAMB.
- Parameters:
atomic_samb (dict) – all atomic SAMB, Dict[braket_info, SAMB].
cluster_samb (dict) – alll cluster SAMB, Dict[“site/bond”, SAMB].
select (dict) – SAMB select.
toroidal_priority (bool, optional) – use (G,T) prior to (Q,M) in creation ?
- Returns:
(dict) – combined SAMB (minimal), dict[SAMBType, SAMB].
(dict) – id to SAMB info, dict[str, (tag, UniqueSAMBType, component)].
(int) – no. of minimal SAMBs.
(int) – no. of all SAMBs.
(dict) – comomon id, dict[SAMBType, [id]].
(dict) – cluster info, dict[site/bond_name, dict[(bra_rank,ket_rank), (wyckoff,z_list)] ].
- get_combined_samb_matrix(select=None, fmt='sympy', digit=14, bond=True)[source]#
Get combined SAMBs in matrix form (real-space).
- Parameters:
select (dict, optional) – select conditions for multipoles with keywords (see, select_combined_samb).
fmt (str, optional) – sympy/value.
digit (int, optional) – digit for value output.
bond (bool, optional) – include bond_d ?
- Returns:
(dict) – combined SAMB in matrix form, dict[zj, dict[ (n1, n2, n3, m, n), (matrix element, bond_no)] ].
Note
R = (n1,n2,n3) and m and n are lattice indices (corresponding to bond_no), bra and ket indexes, respectively.
- get_hr(parameter, combined_samb_matrix, fmt='sympy')[source]#
Get Hamiltonian matrix (real-space).
- Parameters:
parameter (dict) – parameter of SAMBs, dict[zj, float/sympy].
combined_samb_matrix (dict) – combined SAMBs in matrix form (real-space), dict[zj, dict[(n1, n2, n3, m, n), (matrix element, bond_no)] ].
fmt (str, optional) – sympy/value.
- Returns:
(dict) – Hamiltonian matrix (real-space), dict[(n1, n2, n3, m, n), (matrix element, bond_no)].
Note
R = (n1,n2,n3) and m and n are a lattie vector (corresponding to bond_no), bra and ket indexes, respectively.
- get_ket_site()[source]#
Get ket and corresponding site.
- Returns:
(dict) – ket and site, dict[name, position].
- get_multipole_expression()[source]#
Get all of harmonics expression.
- Returns:
(dict) – harmonics expression, dict[(X,Gamma,l,n), [expression]].
- get_samb_matrix(select)[source]#
Get SAMB matrix.
- Parameters:
select (dict) – select dict (see, select_combined_samb).
- Returns:
(dict) – matrix info.
- image_overlap(op=None, parent=None, embedding=None)[source]#
Get S_kj = <Z_k, g Z_j>, its eigenvalues and eigenvectors.
- Parameters:
op (str or array, optional) – g (see transform_samb).
parent (str, optional) – supergroup P (see transform_samb).
embedding (None, int, dict or array, optional) – embedding (see transform_samb).
- Returns:
(dict) – “parent”, “rep”, “order” n, “embedding” (None for the parents of the binaries), “samb” ([z]), “S” (ndarray, S[k, j]), “eigenvalue”, “eigenvector” (columns), “projection” ([n Pi^(m)] for m = 0..n-1, see parent_forbidden_part), “complete” (every g^t Z_j lies on the bonds of the model), “shell” (parent_shells), “parent_structure”.
Note
S is a constant matrix of the model and g; its diagonal is w(+) - w(-) of “weight” (order 2).
S gives <g Z_j> = sum_k S_kj <Z_k> for a state invariant under H only if the model contains the whole neighbor shells of the parent structure (“complete”).
- map_bond(op=None, parent=None, embedding=None)[source]#
Get the bonds of the model moved by g on the parent structure.
- Parameters:
op (str or array, optional) – g (see transform_samb).
parent (str, optional) – supergroup P (see transform_samb).
embedding (None, int, dict or array, optional) – embedding (see transform_samb).
- Returns:
- [{“bond”: (tail atom, head atom, n), “image”: (tail atom, head atom, n), “neighbor” (of the
image in the model structure), “distance”}]}, atoms: (site, sublattice), n: lattice vector (conventional), for the bonds from the first tail atom.
- Return type:
(dict) – {bond
- parent_forbidden_part(expectation, op=None, parent=None, embedding=None, by_eigenvalue=False)[source]#
Get F_j, the part of Z_j forbidden by the parent, from the expectation values <Z_k>.
- Parameters:
expectation (dict or array) – <Z_k>, {z: value} or in the order of the SAMB of the model.
op (str or array, optional) – g (see transform_samb).
parent (str, optional) – supergroup P (see transform_samb).
embedding (None, int, dict or array, optional) – embedding (see transform_samb).
by_eigenvalue (bool, optional) – give F_j^(m) for each eigenvalue w^m of g instead of F_j ?
- Returns:
F_j}, or {z: [F_j^(m) for m = 0..n-1]} (by_eigenvalue).
- Return type:
(dict) – {z
Note
with the projections Pi_m = (1/n) sum_t w^(-m t) g^t (w = exp(2 pi i/n), n: order of g) on the parent structure, F_j^(m) = n <Pi_m Z_j> = sum_k sum_t w^(-m t) S^(t)_kj <Z_k> (S^(t)_kj = <Z_k, g^t Z_j>) for a state invariant under H, and F_j = sum_{m>0} F_j^(m) = n <Z_j> - sum_t <g^t Z_j> (real). F_j^(0) is the part allowed by the parent, sum_m F_j^(m) = n <Z_j>.
n = 2 (e.g., the inversion): F_j = <Z_j> - <g Z_j> = sum_k (delta_kj - S_kj) <Z_k>; 0 on the parent structure, eps_j F_j in the inversion model, -F_j for the image state with the same matrix.
a warning is given if the model does not contain the whole neighbor shells of the parent structure.
- parent_shells(parent=None, embedding=None)[source]#
Get the neighbor shells of the parent structure and the neighbors of the model structure in each.
- Parameters:
parent (str, optional) – supergroup P (see transform_samb).
embedding (None, int, dict or array, optional) – embedding (see transform_samb).
- Returns:
- [{“shell”, “distance” (parent structure), “neighbor” ([n] of the model
structure), “model” ([n] in the bonds of the model), “complete”}]}.
- Return type:
(dict) – {(tail, head)
- save_samb_qtdraw(samb_figure=True, png=False, verbose=None)[source]#
Save SAMB QtDraw files in “<model>/samb/”.
- Parameters:
samb_figure (bool or list, optional) – True for all the atomic SAMBs, and the cluster and combined SAMBs of the sites and of the bonds with neighbor < qtdraw/max_neighbor, or list of SAMB tags (x: atomic, y: cluster, z: combined), e.g. [“x1”, “y2”, “z3”].
png (bool, optional) – save also PNG files “<model>_<tag>.png” ?
verbose (bool, optional) – verbose ?
Notes
The file of each SAMB is “<model>_<tag>.qtdw”.
The polar (Q, T) and the axial (G, M) parts of the atomic SAMB are drawn separately: lobes colored by sign for polar parts, and translucent lobes with axial-vector arrows for axial parts (see util_samb_figure). A cluster SAMB is drawn as a combined SAMB with the atomic SAMB Q0.
- transform_samb(op=None, z=None, parent=None, embedding=None)[source]#
Get g Z_j: the combined SAMB moved by an element g of a supergroup P, in the basis of the model.
- Parameters:
op (str or array, optional) – g (“point operation of P:[translation in the coordinates of H]” or 4x4 in the coordinates of H); default: the first coset of the binaries for their parents, the first coset other than H (the inversion if any, a translation only if no other) otherwise.
z (str or [str], optional) – SAMB (default: all).
parent (str, optional) – supergroup P (default: the direct parent of the binaries).
embedding (None, int, dict or array, optional) – embedding of H in P (Group.embedding); default: the one whose parent structure is the nearest to the model.
- Returns:
{(n1, n2, n3, a, b): value}}, as get_combined_samb_matrix(fmt=”value”, bond=False).
- Return type:
(dict) – {z
Note
the atoms are matched on the parent structure (the limit of the Wyckoff parameters at which the structure is invariant under P), the orbitals are transformed by g.
- property group#
Group class.
- Returns:
(Group) – group class.