Material Model#
Utility for MaterialModel class.
- convert_orbital_index(basis_set, basis_info_type)[source]#
Convert to orbital index.
- Parameters:
basis_set ([[str]]) – atomic basis.
basis_info_type (dict) – basis info. of given basis_type.
- Returns:
([[int]]) – orbital index corresponding to basis set.
- create_braket_dict(rep_site, rep_bond, basis_info_type)[source]#
Create site_bond to braket dict.
- Parameters:
rep_site (dict) – representative site dict.
rep_bond (dict) – representative bond dict.
basis_info_type (str) – basis info type.
- Returns:
(dict) – site_bond to braket dict, Dict[site_bond, [BraketInfoType]].
- create_combined_cluster_info(combined_id, bond_cell)[source]#
Create combined cluster info.
- Parameters:
combined_id (dict) – combined_id.
bond_cell (dict) – bond in cell.
- Returns:
(dict) – zj, site_bond dict, dict[zj, site_bond name].
(dict) – site_bond, primitive bond vecotr, dict[site_bond name, bond vector in primitive cell].
- create_equivalent_bond(so, pset, bond)[source]#
Create unique bonds.
- Parameters:
so (ndarray) – symmetry operation (conventional) (PG:3x3) or (SG:4x4).
pset (ndarray) – plus set.
bond (ndarray) – source bond.
- Returns:
(ndarray) – unique bonds.
- create_full_matrix_info(site_dict, basis_info_type)[source]#
Create full matrix info.
- Parameters:
site_dict (dict) – site dict.
basis_info_type (dict) – atomic basis in each rank.
- Returns:
[(name, sublattice, rank, basis_idx, orbital)], “index”: Dict[(atom,sublattice,rank), (top_idx, size)].
- Return type:
(dict) – full matrix info, “ket”
- create_qtdraw(qtdraw, group, name, cell_info, site_dict, bond_dict, prop)[source]#
Create QtDraw.
- Parameters:
qtdraw (PyVistaWidget) – PyVistaWidget.
group (dict) – group dict.
name (str) – model name.
cell_info (dict) – cell info. dict.
site_dict (dict) – site dict.
bond_dict (dict) – bond dict.
prop (dict) – property dict.
- create_representative_bond(group, G, so, tail, heads, max_neighbor)[source]#
Create representative bonds.
- Parameters:
group (dict) – group dict.
G (ndarray) – metric tensor (3x3).
so (ndarray) – symmetry operations (nx3x3).
tail (ndarray) – tail position.
heads (ndarray) – head positions over symmetry related with grid.
max_neighbor (int) – max. neighbor.
- Returns:
(list) – representative bonds for each neighbor.
- create_site_grid(site_dict, igrid=None)[source]#
Create site grid.
- Parameters:
site_dict (dict) – site dict.
igrid (ndarray, optional) – integer grid.
- Returns:
(dict) – site grid (sorted), Dict[name, Dict[(#sublattice,#plus_set,i1,i2,i3), position]].
Note
if igrid is None, [[0,0,0]] is used.
- create_site_so(group, site_dict)[source]#
Create symmetry operations for first Wyckoff site.
- Parameters:
group (dict) – group dict.
site_dict (dict) – site dict.
- Returns:
(dict) – symmetry operations except identity, Dict[name, SOs].
- create_wyckoff_dict(rep_site, rep_bond)[source]#
Create site_bond to wyckoff dict.
- Parameters:
rep_site (dict) – representative site dict.
rep_bond (dict) – representative bond dict.
- Returns:
(dict) – site_bond to wyckoff dict, Dict[site_bond, wyckoff].
- enlarge_head_grid(G, tail, head_grid, cell_site, distance)[source]#
Head sites on a search grid enlarged to contain every head site within distance from tail.
- Parameters:
G (ndarray) – metric tensor (3x3).
tail (ndarray) – tail position (fractional).
head_grid (dict) – head sites on the current search grid.
cell_site (list) – CellSiteType of the head site in the unit cell.
distance (float) – required distance.
- Returns:
(dict) – head sites on the enlarged grid.
- get_basis_type(site_data, spinful)[source]#
Get atomic basis type.
- Parameters:
site_data (dict) – site data.
spinful (bool) – spinful basis ?
- Returns:
(str) – atomic basis type, “jml/lgs/lg”.
- get_bond(tail, head, n, no)[source]#
Get bond name.
- Parameters:
tail (str) – tail atom.
head (str) – head atom.
n (int) – neighbor (from 1).
no (int) – multiplicity (from 1).
- Returns:
(str) – bond name.
- get_neighbor_info(site_bond)[source]#
Get neighbor info.
- Parameters:
site_bond (str) – site or bond tag.
- Returns:
(int) – neighbor (0 for site).
(int) – multiplicity (-1 for site).
- get_tail_head(site_bond)[source]#
Get tail and head atoms.
- Parameters:
site_bond (str) – site or bond tag.
- Returns:
(str) – tail atom.
(str) – head atom.
- get_unique_bond(bond, tol=1e-06)[source]#
Get unique bond.
- Parameters:
bond (ndarray) – set of bonds.
tol (float, optional) – tolerance.
- Returns:
(ndarray) – unique bonds.
- parse_combined_select(select, irreps, default_samb_select, site_rep, bond_rep)[source]#
Parse select dict for combined SAMB.
- Parameters:
select (dict) – select condition dict.
irreps (list) – list of irreps.
default_samb_select (dict) – default SAMB select.
site_rep (dict) – site representative dict.
bond_rep (dict) – bond representative dict.
- Returns:
(dict) – regularized SAMB select.
(dict) – regularized other select.
Note
dict keys are “site” and “bond” in addition to SAMB_select.
null list represents all possible values.
- parse_neighbor(neighbor, tail_rank, head_rank)[source]#
Parse neighbor.
- Parameters:
neighbor (int or [int] or tuple) – neighbor info., (int or [int], [tail rank], [head rank]).
tail_rank ([int] or [str]) – tail rank.
head_rank ([int] or [str]) – head rank.
- Returns:
(tuple) – ([neighbor], [tail rank], [head rank]).
- parse_orbital(orbital, basis_type, basis_info)[source]#
Parse atomic orbital information. ### input check needs to be implemented!!!
- Parameters:
orbital (str or list) – orbital information.
basis_type (str) – atomic orbital type.
basis_info (dict) – basis info.
- Returns:
([[str]]) – atomic basis in order of rank, s,p,d,f.
Notes
orbital format (str), each orbital (px, dxz, …) or orbital set (p, (3/2,p), …).
orbital format (list), set of the above format.
returned list is in full expression in fixed order compatible with atomic matrix element.
coexistence of spinless and spinfull, or different basis types (jml, lgs, lg) is not allowed.
- parse_representative_bond(group, G, site_grid, site_so, site_dict, bond_data, verbose, rep_bond_given=None)[source]#
Parse representative bond.
- Parameters:
group (dict) – group dict.
G (ndarray) – metric tensor (3x3).
site_grid (dict) – site grid dict.
site_so (dict) – site SO dict.
site_dict (dict) – site dict.
bond_data (list) – bond data.
verbose (bool) – verbose progress bar ?
rep_bond_given (dict, optional) – representative bonds used instead of the search, {(tail, head): [bonds of the n-th neighbor (vector+center), …]} (the inversion model).
- Returns:
(dict) – bond dict.
(list) – atomic orbital rank list, [(tail,head,tail_rank,head_rank)].
Notes
“representative”: representative bond, Dict[name, RepBondType].
“cell”: cell bond, Dict[name, [CellBondType] ].
“neighbor”: Dict[name, Dict[#neighbor, [rep_bond_tag] ]].
“info”: [BondInfoType].
- parse_representative_site(group, site_data, basis_type, basis_info)[source]#
Parse representative site.
- Parameters:
group (dict) – group dict.
site_data (dict) – site data.
basis_type (str) – atomic basis type, “jml/lgs/lg”.
basis_info (dict) – basis info dict.
- Returns:
(dict) – site dict.
(list) – atomic orbital rank list, [(tail,head,tail_rank,head_rank)].
Notes
“representative”: representative site, Dict[name, RepSiteType].
“cell”: cell site, Dict[name, [CellSiteType] ].
- parse_samb_select(select, irreps)[source]#
Parse SAMB select dict.
- Parameters:
select (dict) – select condition dict.
irreps (list) – list of irreps.
- Returns:
(dict) – regularized SAMB select.
Note
dict keys are “X”, “l”, “Gamma”, “s”.
null list represents all possible values.
“IR” in “Gamma” indicates the identity representation.
- qtdraw_bond(qtdraw, bond_dict, max_neighbor, scale, mode, width, show_rep_bond)[source]#
Draw bond by QtDraw.
- Parameters:
qtdraw (QtDraw) – QtDraw widget or application.
bond_dict (dict) – bond dict.
max_neighbor (int) – max. neighbor to draw.
scale (float) – scale.
mode (str) – draw mode, “standard/detail”.
width (float) – base width.
show_rep_bond (bool) – show representative bond?
- qtdraw_site(qtdraw, site_dict, scale, mode, radius, show_rep_site)[source]#
Draw site by QtDraw.
- Parameters:
qtdraw (QtDraw) – QtDraw widget or application.
site_dict (dict) – site dict.
scale (float) – scale.
mode (str) – draw mode, “standard/detail”.
radius (float) – base radius.
show_rep_site (bool) – show representative site?
- remove_equivalent_representative_bond(so, pset, bonds)[source]#
Remove equivalnet representative bond.
- Parameters:
so (ndarray) – symmetry operation (conventional, fractional, 3x3 or 4x4).
pset (ndarray) – plus set.
bonds (ndarray) – set of representative bonds.
- Returns:
(ndarray) unique representative bonds.
- search_box(G, tail, head_grid)[source]#
Region of the search grid that holds every image of the head sites.
- Parameters:
G (ndarray) – metric tensor (3x3).
tail (ndarray) – tail position (fractional).
head_grid (dict) – head sites on the search grid, Dict[(sublattice, plus_set, n1, n2, n3), position].
- Returns:
(float) – largest distance from tail within which the grid contains every head site.
(ndarray) – min. and max. grid offsets (2x3).
(ndarray) – max. and min. positions at zero offset (2x3).
(ndarray) – distance between the lattice planes x_i = 0 and x_i = 1 (3).
Notes
along a_i the grid holds every image whose coordinate lies in [L_i, U_i], L_i = min(n_i) + max(p_i) and U_i = max(n_i) + min(p_i), where p are the positions at zero offset.
- unique_bond_index(bond, tol=1e-06)[source]#
Unique bond index.
- Parameters:
bond (ndarray) – bond set.
tol (float, optional) – tolerance.
- Returns:
(list) – unique index.
- unique_vector_index(vectors, so, tol=1e-06)[source]#
Get unique vector indices (remove SO related vecrors).
- Parameters:
vectors (ndarray) – vectors.
so (ndarray) – set of symmetry operations (3x3) except for identity.
tol (float, optional) – tolerance to check same vector.
- Returns:
(ndarray) – unique vector indices.
- REMOVED_MODEL_KEY = ['max_neighbor', 'search_cell_range']#
Model keys removed in MultiPie Ver.3 (the neighbors are given by “bond” only, and the bond search range is automatic).
- RENAMED_ORBITAL = {'f1': 'fs', 'f2': 'fc', 'f3x': 'fx', 'f3y': 'fy'}#
f orbitals renamed in MultiPie Ver.3 (old -> new). The old names are not accepted.
- SEARCH_CELL_RANGE = (-2, 3, -2, 3, -2, 3)#
Initial cell range to search bonds (SG), (a1,a2,b1,b2,c1,c2). It is enlarged for a bond when it does not contain every site up to the requested neighbor shell.