PAOFLOW.elphon.coupling_cache#
Disk cache of the doubly real-space vertex g(R_e, R_p) between runs.
Building g(R_e, R_p) (prepare_dense_vertex())
depends only on the coarse coupling, the grids, the masses and the PAO basis, not on the
dense grids, temperatures or properties computed afterwards. With cache_dir the array
is written once (g_ReRp_<key>.npy plus a <key>.json provenance file) and later
runs fill the shared window from disk. The key hashes the coupling files (names and
sizes), the grids, the masses, the shape of the projections and a caller-supplied
cache_tag that identifies the PAO basis (basis_tag()); the values of the
projections are not hashed because they are not reproducible across machines at the
rounding level.
Functions#
|
Signature of the PAO basis of a |
|
Key of a |
|
|
|
Fill |
|
Write |
Module Contents#
- PAOFLOW.elphon.coupling_cache.basis_tag(data_controller, pthr=None)[source]#
Signature of the PAO basis of a
DataController(forcache_tag).- Parameters:
data_controller (DataController) – After
projections(arrays['basis']) andprojectability.pthr (float, optional) – Projectability threshold used, appended to the tag.
- Returns:
"<n orbitals>:<species and shells>:<nbnd>[:pthr]".- Return type:
- PAOFLOW.elphon.coupling_cache.dense_vertex_cache_key(coupling_dir, source, qgrid_coarse, ng, masses_amu, projection_shape, cache_tag)[source]#
Key of a
g(R_e, R_p)cache entry.- Parameters:
- Returns:
A 16-character hexadecimal digest.
- Return type:
- PAOFLOW.elphon.coupling_cache.cache_paths(cache_dir, key)[source]#
(array file, provenance file)of a key.
- PAOFLOW.elphon.coupling_cache.load_dense_vertex(cache_dir, key, g_ReRp)[source]#
Fill
g_ReRpfrom the cache (row by row, to bound the memory).- Parameters:
- Returns:
Falsewhen no entry exists.- Return type:
- Raises:
ValueError – If the cached shape differs from
g_ReRp.shape.