Material Model#
Utility for MaterialModel calss.
- 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_atomic_samb_qtdraw(qtdraw, mm, name)[source]#
Create atomic SAMB QtDraw file.
- Parameters:
qtdraw (PyVistaWidget) – PyVistaWidget.
mm (MaterialModel) – material model.
name (str) – model name.
- 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_cluster_samb_qtdraw(qtdraw, mm, site_bond, name)[source]#
Create cluster SAMB QtDraw file.
- Parameters:
qtdraw (PyVistaWidget) – PyVistaWidget.
mm (MaterialModel) – material model.
site_bond (str or list) – (list of) site or bond.
name (str) – model name.
- 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)[source]#
Create full matrix info.
- Parameters:
site_dict (dict) – site dict.
- Returns:
[(name, sublattice, rank, 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].
- 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, max_neighbor, verbose)[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.
max_neighbor (int) – max. neighbor.
verbose (bool) – verbose progress bar ?
- 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.
- 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.