Skip to content

Commit

Permalink
Develop (usnistgov#216)
Browse files Browse the repository at this point in the history
* Image augmentation.

* Augment images.

* Augment images.

* Specie update.

* Add Latt2D, STM image (b-1) fix, image augmentation fix.

* Add Latt2D, STM image (b-1) fix, image augmentation fix.

* Update conf.py

* Update conf.py

* Multi-output graph bacthing.

* Add EDOS dataset.

* Temp.

* Add circuit maker.

* Add circuit maker.

* NELECT update.

* Version update, more DBs added.

* Fix CHGCAR vasp.

* Added volumetric reshape for CHGCAR.

* Tmp

* Tershoff Hamman update, specie update.

* Add crop from center in STM.

* Add Fourier transfor in STM.

* Update STM pytest.

* Add DPI to STM.

* Zeo++ added, Atoms cif update, STM update, random vacancy maker added.

* Atoms tempfile fix, Potcar from atoms module added.

* Test for docs.

* C2DB link update, docs Atoms update.

* C2DB link update, docs Atoms update.

* Version update, COD DB, QM9 JCTC DB added.

* Compostion bug fix, elemental descriptor added.

* Develop (usnistgov#186)

* Update outputs.py

I added the calculation of the Raman intensities inside parse_raman_dat

* Update outputs.py

* Update outputs.py

* Update outputs.py

* Update cfid.py

* Delete __init__.py

* stylecss added.

* stylecss added.

* Adding extra Makefile/

* Remove examples from docs.

* Docs update.

* Docs update.

* Docs update.

* Docs update.

* Docs update.

* Docs update.

* Docs update.

* Docs update.

* Docs update.

* Docs update.

* Tutorials update.

* Tutorials docs update.

* Docs update,pdb reader updated.

* Update action_build.yml

* Update action_build.yml

* Remove pytraj strong dependencies.

* Update docs, Added PDBBind and HPOV datasets.

* Docs update.

* Add thcikness to surface builder.

* Surface builder update, Chemical only magpie descriptors added, pdb_core dataset added, zeopp tempfile bugfix.

* Typo fix.

* Add names to chem descs.

* Lessen hermsolver pytest.

* Reduced pytest.

* Reduced pytest.

* Reduced pytest.

* Reduced pytest.

* Reduced pytest.

* No DFT3D

* Exclude dft_3d dataset for memory issue.

* Update figshare test.

* Update figshare test.

* Exclude db from coverage.

* Exclude db from coverage.

* Add magpie.json.

* Add magpie.json.

* Wien2k bands bug fix.

* Wien2k bands bug fix.

* Update JARVIS-FF,Elastictensor,LAMMPS parse folder, VASP bandstructure plot code.

* JFF update.

* Add JQE_TB3 and hMOF dataset.

* Update LAMMPS module.

* Update LAMMPS module.

* Fix elastic tensor module.

* Figshare update, docs db name update.

* Substitutions.

* Update figshare dft_3d, cfid_3d.

* Docs data update.

* Generate substitutions.

* Lint fix.

* Update DOS.

* Update DOS.

* Adding folders for nexus setup.

* Update QMOF and hMOF info.

* Fixing auto klength error.

* Adding zeopp surface area.

* Vacancy bug fix, added hmof to docs.

* vacancy update.

* QE inputs update.

* Pyhon 3.9 test, added QE el-ph, VASP XANES, modified hmof db details.

* Update Contribution.rst

* Minor lint fix.

* Update action_build.yml

* Update action_build.yml

* Fix qiskit requirements.

* Fix phonopy requirements.

* Fix all requirements.

* Fix phonopy requirements.

* QE test.

* QE test.

* Update action_build.

* Try other python versions.

* Try other python versions.

* README updates.

* Adding nexus. (usnistgov#197)

* Develop (usnistgov#196)

* Image augmentation.

* Augment images.

* Augment images.

* Specie update.

* Add Latt2D, STM image (b-1) fix, image augmentation fix.

* Add Latt2D, STM image (b-1) fix, image augmentation fix.

* Update conf.py

* Update conf.py

* Multi-output graph bacthing.

* Add EDOS dataset.

* Temp.

* Add circuit maker.

* Add circuit maker.

* NELECT update.

* Version update, more DBs added.

* Fix CHGCAR vasp.

* Added volumetric reshape for CHGCAR.

* Tmp

* Tershoff Hamman update, specie update.

* Add crop from center in STM.

* Add Fourier transfor in STM.

* Update STM pytest.

* Add DPI to STM.

* Zeo++ added, Atoms cif update, STM update, random vacancy maker added.

* Atoms tempfile fix, Potcar from atoms module added.

* Test for docs.

* C2DB link update, docs Atoms update.

* C2DB link update, docs Atoms update.

* Version update, COD DB, QM9 JCTC DB added.

* Compostion bug fix, elemental descriptor added.

* Develop (usnistgov#186)

* Update outputs.py

I added the calculation of the Raman intensities inside parse_raman_dat

* Update outputs.py

* Update outputs.py

* Update outputs.py

* Update cfid.py

* Delete __init__.py

* stylecss added.

* stylecss added.

* Adding extra Makefile/

* Remove examples from docs.

* Docs update.

* Docs update.

* Docs update.

* Docs update.

* Docs update.

* Docs update.

* Docs update.

* Docs update.

* Docs update.

* Docs update.

* Tutorials update.

* Tutorials docs update.

* Docs update,pdb reader updated.

* Update action_build.yml

* Update action_build.yml

* Remove pytraj strong dependencies.

* Update docs, Added PDBBind and HPOV datasets.

* Docs update.

* Add thcikness to surface builder.

* Surface builder update, Chemical only magpie descriptors added, pdb_core dataset added, zeopp tempfile bugfix.

* Typo fix.

* Add names to chem descs.

* Lessen hermsolver pytest.

* Reduced pytest.

* Reduced pytest.

* Reduced pytest.

* Reduced pytest.

* Reduced pytest.

* No DFT3D

* Exclude dft_3d dataset for memory issue.

* Update figshare test.

* Update figshare test.

* Exclude db from coverage.

* Exclude db from coverage.

* Add magpie.json.

* Add magpie.json.

* Wien2k bands bug fix.

* Wien2k bands bug fix.

* Update JARVIS-FF,Elastictensor,LAMMPS parse folder, VASP bandstructure plot code.

* JFF update.

* Add JQE_TB3 and hMOF dataset.

* Update LAMMPS module.

* Update LAMMPS module.

* Fix elastic tensor module.

* Figshare update, docs db name update.

* Substitutions.

* Update figshare dft_3d, cfid_3d.

* Docs data update.

* Generate substitutions.

* Lint fix.

* Update DOS.

* Update DOS.

Co-authored-by: tavazza <[email protected]>
Co-authored-by: knc6 <[email protected]>
Co-authored-by: KAMAL CHOUDHARY <[email protected]>

* First input.

* added black

* Example folder.

Co-authored-by: Kamal Choudhary <[email protected]>
Co-authored-by: tavazza <[email protected]>
Co-authored-by: knc6 <[email protected]>
Co-authored-by: KAMAL CHOUDHARY <[email protected]>

* Revert back.

* Update .readthedocs.yaml

* Update dev-requirements.txt

* Docs requirements update.

* Update .readthedocs.yaml

* Update requirements.txt

* Update .readthedocs.yaml

* Update requirements.txt

* Update .readthedocs.yaml

* Update requirements.txt

* Update requirements.txt

* Update requirements.txt

* Update requirements.txt

* Update requirements.txt

* Update atoms.py

* Fixe pbc in ase_to_Atoms.

* Add installation tests (usnistgov#214)

* QE inputs, XANES, GHAction updates. (usnistgov#210)

* Image augmentation.

* Augment images.

* Augment images.

* Specie update.

* Add Latt2D, STM image (b-1) fix, image augmentation fix.

* Add Latt2D, STM image (b-1) fix, image augmentation fix.

* Update conf.py

* Update conf.py

* Multi-output graph bacthing.

* Add EDOS dataset.

* Temp.

* Add circuit maker.

* Add circuit maker.

* NELECT update.

* Version update, more DBs added.

* Fix CHGCAR vasp.

* Added volumetric reshape for CHGCAR.

* Tmp

* Tershoff Hamman update, specie update.

* Add crop from center in STM.

* Add Fourier transfor in STM.

* Update STM pytest.

* Add DPI to STM.

* Zeo++ added, Atoms cif update, STM update, random vacancy maker added.

* Atoms tempfile fix, Potcar from atoms module added.

* Test for docs.

* C2DB link update, docs Atoms update.

* C2DB link update, docs Atoms update.

* Version update, COD DB, QM9 JCTC DB added.

* Compostion bug fix, elemental descriptor added.

* Develop (usnistgov#186)

* Update outputs.py

I added the calculation of the Raman intensities inside parse_raman_dat

* Update outputs.py

* Update outputs.py

* Update outputs.py

* Update cfid.py

* Delete __init__.py

* stylecss added.

* stylecss added.

* Adding extra Makefile/

* Remove examples from docs.

* Docs update.

* Docs update.

* Docs update.

* Docs update.

* Docs update.

* Docs update.

* Docs update.

* Docs update.

* Docs update.

* Docs update.

* Tutorials update.

* Tutorials docs update.

* Docs update,pdb reader updated.

* Update action_build.yml

* Update action_build.yml

* Remove pytraj strong dependencies.

* Update docs, Added PDBBind and HPOV datasets.

* Docs update.

* Add thcikness to surface builder.

* Surface builder update, Chemical only magpie descriptors added, pdb_core dataset added, zeopp tempfile bugfix.

* Typo fix.

* Add names to chem descs.

* Lessen hermsolver pytest.

* Reduced pytest.

* Reduced pytest.

* Reduced pytest.

* Reduced pytest.

* Reduced pytest.

* No DFT3D

* Exclude dft_3d dataset for memory issue.

* Update figshare test.

* Update figshare test.

* Exclude db from coverage.

* Exclude db from coverage.

* Add magpie.json.

* Add magpie.json.

* Wien2k bands bug fix.

* Wien2k bands bug fix.

* Update JARVIS-FF,Elastictensor,LAMMPS parse folder, VASP bandstructure plot code.

* JFF update.

* Add JQE_TB3 and hMOF dataset.

* Update LAMMPS module.

* Update LAMMPS module.

* Fix elastic tensor module.

* Figshare update, docs db name update.

* Substitutions.

* Update figshare dft_3d, cfid_3d.

* Docs data update.

* Generate substitutions.

* Lint fix.

* Update DOS.

* Update DOS.

* Adding folders for nexus setup.

* Update QMOF and hMOF info.

* Fixing auto klength error.

* Adding zeopp surface area.

* Vacancy bug fix, added hmof to docs.

* vacancy update.

* QE inputs update.

* Pyhon 3.9 test, added QE el-ph, VASP XANES, modified hmof db details.

* Update Contribution.rst

* Minor lint fix.

* Update action_build.yml

* Update action_build.yml

* Fix qiskit requirements.

* Fix phonopy requirements.

* Fix all requirements.

* Fix phonopy requirements.

* QE test.

* QE test.

* Update action_build.

* Try other python versions.

* Try other python versions.

* README updates.

* Adding nexus. (usnistgov#197)

* Develop (usnistgov#196)

* Image augmentation.

* Augment images.

* Augment images.

* Specie update.

* Add Latt2D, STM image (b-1) fix, image augmentation fix.

* Add Latt2D, STM image (b-1) fix, image augmentation fix.

* Update conf.py

* Update conf.py

* Multi-output graph bacthing.

* Add EDOS dataset.

* Temp.

* Add circuit maker.

* Add circuit maker.

* NELECT update.

* Version update, more DBs added.

* Fix CHGCAR vasp.

* Added volumetric reshape for CHGCAR.

* Tmp

* Tershoff Hamman update, specie update.

* Add crop from center in STM.

* Add Fourier transfor in STM.

* Update STM pytest.

* Add DPI to STM.

* Zeo++ added, Atoms cif update, STM update, random vacancy maker added.

* Atoms tempfile fix, Potcar from atoms module added.

* Test for docs.

* C2DB link update, docs Atoms update.

* C2DB link update, docs Atoms update.

* Version update, COD DB, QM9 JCTC DB added.

* Compostion bug fix, elemental descriptor added.

* Develop (usnistgov#186)

* Update outputs.py

I added the calculation of the Raman intensities inside parse_raman_dat

* Update outputs.py

* Update outputs.py

* Update outputs.py

* Update cfid.py

* Delete __init__.py

* stylecss added.

* stylecss added.

* Adding extra Makefile/

* Remove examples from docs.

* Docs update.

* Docs update.

* Docs update.

* Docs update.

* Docs update.

* Docs update.

* Docs update.

* Docs update.

* Docs update.

* Docs update.

* Tutorials update.

* Tutorials docs update.

* Docs update,pdb reader updated.

* Update action_build.yml

* Update action_build.yml

* Remove pytraj strong dependencies.

* Update docs, Added PDBBind and HPOV datasets.

* Docs update.

* Add thcikness to surface builder.

* Surface builder update, Chemical only magpie descriptors added, pdb_core dataset added, zeopp tempfile bugfix.

* Typo fix.

* Add names to chem descs.

* Lessen hermsolver pytest.

* Reduced pytest.

* Reduced pytest.

* Reduced pytest.

* Reduced pytest.

* Reduced pytest.

* No DFT3D

* Exclude dft_3d dataset for memory issue.

* Update figshare test.

* Update figshare test.

* Exclude db from coverage.

* Exclude db from coverage.

* Add magpie.json.

* Add magpie.json.

* Wien2k bands bug fix.

* Wien2k bands bug fix.

* Update JARVIS-FF,Elastictensor,LAMMPS parse folder, VASP bandstructure plot code.

* JFF update.

* Add JQE_TB3 and hMOF dataset.

* Update LAMMPS module.

* Update LAMMPS module.

* Fix elastic tensor module.

* Figshare update, docs db name update.

* Substitutions.

* Update figshare dft_3d, cfid_3d.

* Docs data update.

* Generate substitutions.

* Lint fix.

* Update DOS.

* Update DOS.

Co-authored-by: tavazza <[email protected]>
Co-authored-by: knc6 <[email protected]>
Co-authored-by: KAMAL CHOUDHARY <[email protected]>

* First input.

* added black

* Example folder.

Co-authored-by: Kamal Choudhary <[email protected]>
Co-authored-by: tavazza <[email protected]>
Co-authored-by: knc6 <[email protected]>
Co-authored-by: KAMAL CHOUDHARY <[email protected]>

* Revert back.

* Update .readthedocs.yaml

* Update dev-requirements.txt

* Docs requirements update.

* Update .readthedocs.yaml

* Update requirements.txt

* Update .readthedocs.yaml

* Update requirements.txt

* Update .readthedocs.yaml

* Update requirements.txt

* Update requirements.txt

* Update requirements.txt

* Update requirements.txt

* Update requirements.txt

* Update atoms.py

* Fixe pbc in ase_to_Atoms.

Co-authored-by: tavazza <[email protected]>
Co-authored-by: knc6 <[email protected]>
Co-authored-by: KAMAL CHOUDHARY <[email protected]>
Co-authored-by: wines1 <[email protected]>

* Add installation tests

* Fix codestyle

* Fix codestyle with black

* Add docstrings

* Fix pydocstyle error

* Update __init__.py

* Update __init__.py

Co-authored-by: Kamal Choudhary <[email protected]>
Co-authored-by: tavazza <[email protected]>
Co-authored-by: knc6 <[email protected]>
Co-authored-by: KAMAL CHOUDHARY <[email protected]>
Co-authored-by: wines1 <[email protected]>

* Adding QE super.

* Minor changes to QE module, atoms xyz fix.

* Adding qe_tb info, and version update.

* Update __init__.py

Co-authored-by: tavazza <[email protected]>
Co-authored-by: knc6 <[email protected]>
Co-authored-by: KAMAL CHOUDHARY <[email protected]>
Co-authored-by: wines1 <[email protected]>
Co-authored-by: Saurav Maheshkar <[email protected]>
  • Loading branch information
6 people authored Jan 13, 2022
1 parent 02f9794 commit b48e113
Show file tree
Hide file tree
Showing 12 changed files with 423 additions and 69 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ omit =
*/job*.py
*/restapi*.py
*/_xml*.py
*/qe.py
*/super.py
tequila/*.py
1 change: 1 addition & 0 deletions docs/source/databases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Database name Number of data-points Description
computed with OptB88vdW and TBmBJ methods
``dft_2d`` 1079 Various 2D materials properties in JARVIS-DFT database
computed with OptB88vdW
``qe_tb`` 829574 Various 3D materials properties in JARVIS-QETB database
``stm`` 1132 2D materials STM images in JARVIS-STM database
``wtbh_electron`` 1440 3D and 2D materials Wannier tight-binding Hamiltonian
dtaabase for electrons with spin-orbit coupling
Expand Down
12 changes: 11 additions & 1 deletion jarvis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
"""Version number."""
__version__ = "2021.12.16"
__version__ = "2022.01.10"

import os


def test(*args):
"""Run pytest in the base of jarvis."""
import pytest

path = os.path.join(os.path.split(__file__)[0], "tests")
pytest.main(args=[path] + list(args))
36 changes: 27 additions & 9 deletions jarvis/core/atoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import os
import math
import tempfile
import random

amu_gm = 1.66054e-24
ang_cm = 1e-8
Expand Down Expand Up @@ -580,6 +581,12 @@ def from_xyz(self, filename="dsgdb9nsd_057387.xyz", box_size=40):
f = open(filename, "r")
lines = f.read().splitlines()
f.close()
try:
lattice_mat = np.array(lines[1].split(","), dtype="float").reshape(
3, 3
)
except Exception:
pass
coords = []
species = []
natoms = int(lines[0])
Expand Down Expand Up @@ -764,6 +771,7 @@ def get_all_neighbors(self, r=5, bond_tol=0.15):
return np.array(neighbors, dtype="object")

def get_neighbors_cutoffs(self, max_cut=10, r=5, bond_tol=0.15):
"""Get neighbors within cutoff."""
neighbors = self.get_all_neighbors(r=r, bond_tol=bond_tol)
dists = np.hstack(([[xx[2] for xx in yy] for yy in neighbors]))
hist, bins = np.histogram(dists, bins=np.arange(0.1, 10.2, 0.1))
Expand Down Expand Up @@ -815,6 +823,7 @@ def get_neighbors_cutoffs(self, max_cut=10, r=5, bond_tol=0.15):
def atomwise_angle_and_radial_distribution(
self, r=5, bond_tol=0.15, c_size=10, verbose=False
):
"""Get atomwise distributions."""
rcut1, rcut2, neighbors = self.get_neighbors_cutoffs(
r=r, bond_tol=bond_tol
)
Expand Down Expand Up @@ -1692,19 +1701,29 @@ def build_xanes_poscar(
filename_with_prefix=False,
):
"""Generate POSCAR file for XANES, note the element ordering."""
from jarvis.core.utils import rand_select
# from jarvis.core.utils import rand_select
from jarvis.analysis.structure.spacegroup import Spacegroup3D

dims = get_supercell_dims(
atoms, enforce_c_size=enforce_c_size, extend=extend
)
# spg = Spacegroup3D(atoms)
# wyckoffs = spg._dataset["wyckoffs"]
# atoms.props = wyckoffs
atoms = atoms.make_supercell_matrix(dims)
spath = os.path.join(dir, "POSCAR-supercell.vasp")
atoms.write_poscar(spath)
spg = Spacegroup3D(atoms)
wyckoffs = spg._dataset["wyckoffs"]
atoms.props = wyckoffs
props = rand_select(atoms.props)
# print ('atoms.props',atoms.props)
el_props = []
elements = atoms.elements
for ii, i in enumerate(elements):
if i == selected_element:
el_props.append(ii)
choice = random.choice(el_props)
props = {atoms.props[choice]: choice}
tmp_atoms = atoms
for i, j in props.items():
if tmp_atoms.elements[j] == selected_element:
Expand All @@ -1729,14 +1748,13 @@ def build_xanes_poscar(
filename = os.path.join(dir, filename)
added_strt.props = ["" for i in range(added_strt.num_atoms)]
added_strt.write_poscar(filename)
f = open(filename, "r")
filedata = f.read()
f.close()

with open(filename, "r") as f:
filedata = f.read()
newdata = filedata.replace("XANES", tmp_atoms.elements[j])
f = open(filename, "w")
f.write(newdata)
f.close()
with open(filename, "w") as f:
f.write(newdata)

return atoms


# ['Mn ', 'Mn ', 'Ru ', 'U ']
Expand Down
2 changes: 1 addition & 1 deletion jarvis/db/figshare.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def get_db_info():
"https://ndownloader.figshare.com/files/29070555",
"jqe_tb_folder.json",
"Obtaining QETB dataset 860k...",
"https://www.nature.com/articles/s41524-020-00440-1",
"https://arxiv.org/abs/2112.11585",
],
# https://doi.org/10.6084/m9.figshare.14812050
"omdb": [
Expand Down
6 changes: 4 additions & 2 deletions jarvis/io/qe/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,12 @@ def __init__(
self.cell_params = input_params["cell"]
else:
self.cell_params = {}

if "input" in input_params:
self.input = input_params["input"]
if "amass(1)" not in input_params["input"]:
if (
"amass(1)" not in input_params["input"]
and "zasr" not in input_params["input"]
):
for ii, jj in enumerate(self.atoms.uniq_species):
tmp = "amass(" + str(ii + 1) + ")"
input_params["input"][tmp] = str(
Expand Down
14 changes: 10 additions & 4 deletions jarvis/io/qe/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def get_total_energy(self):
energies = []
for i in self.lines:
if "total energy =" in i:
print(i)
energy = float(i.split()[-2])
energies.append(energy)
return float(energies[-1]) * ryd_to_ev
Expand All @@ -57,6 +56,15 @@ def get_efermi(self):
efs.append(float(i.split()[-2]))
return efs[-1]

@property
def job_done(self):
"""Check if job is completed."""
done = False
for i in self.lines:
if "JOB DONE." in i:
done = True
return done

def get_band_enegies(self):
"""Get band energies in eV."""
band_energies = []
Expand Down Expand Up @@ -381,9 +389,7 @@ class ProjHamXml(object):

# Adapted from https://github.com/kfgarrity/TightlyBound.jl
def __init__(
self,
filename="projham_K.xml",
data=None,
self, filename="projham_K.xml", data=None,
):
"""Initialize class."""
self.filename = filename
Expand Down
105 changes: 54 additions & 51 deletions jarvis/io/vasp/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,62 +106,65 @@ def to_string(self):
def write_file(self, filename):
"""Write the Poscar object to a file."""
# TODO: Use to_string instead of re-writing the code here
f = open(filename, "w")
header = (
str(self.comment)
+ str("\n1.0\n")
+ str(self.atoms.lattice_mat[0][0])
+ " "
+ str(self.atoms.lattice_mat[0][1])
+ " "
+ str(self.atoms.lattice_mat[0][2])
+ "\n"
+ str(self.atoms.lattice_mat[1][0])
+ " "
+ str(self.atoms.lattice_mat[1][1])
+ " "
+ str(self.atoms.lattice_mat[1][2])
+ "\n"
+ str(self.atoms.lattice_mat[2][0])
+ " "
+ str(self.atoms.lattice_mat[2][1])
+ " "
+ str(self.atoms.lattice_mat[2][2])
+ "\n"
)
# order = np.argsort(self.atoms.elements)
coords = self.atoms.frac_coords
# DO NOT USE ORDER
coords_ordered = np.array(coords) # [order]
elements_ordered = np.array(self.atoms.elements) # [order]
props_ordered = np.array(self.atoms.props) # [order]
# check_selective_dynamics = False
counts = get_counts(elements_ordered)
if "T" in "".join(map(str, self.atoms.props[0])):
middle = (
" ".join(map(str, counts.keys()))
with open(filename, "w") as f:
# f = open(filename, "w")
header = (
str(self.comment)
+ str("\n1.0\n")
+ str(self.atoms.lattice_mat[0][0])
+ " "
+ str(self.atoms.lattice_mat[0][1])
+ " "
+ str(self.atoms.lattice_mat[0][2])
+ "\n"
+ " ".join(map(str, counts.values()))
+ "\nSelective dynamics\n"
+ "Direct\n"
)
else:
middle = (
" ".join(map(str, counts.keys()))
+ str(self.atoms.lattice_mat[1][0])
+ " "
+ str(self.atoms.lattice_mat[1][1])
+ " "
+ str(self.atoms.lattice_mat[1][2])
+ "\n"
+ str(self.atoms.lattice_mat[2][0])
+ " "
+ str(self.atoms.lattice_mat[2][1])
+ " "
+ str(self.atoms.lattice_mat[2][2])
+ "\n"
+ " ".join(map(str, counts.values()))
+ "\ndirect\n"
)
rest = ""
# print ('repr',self.frac_coords, self.frac_coords.shape)
for ii, i in enumerate(coords_ordered):
p_ordered = str(props_ordered[ii])
rest = rest + " ".join(map(str, i)) + " " + str(p_ordered) + "\n"
# order = np.argsort(self.atoms.elements)
coords = self.atoms.frac_coords
# DO NOT USE ORDER
coords_ordered = np.array(coords) # [order]
elements_ordered = np.array(self.atoms.elements) # [order]
props_ordered = np.array(self.atoms.props) # [order]
# check_selective_dynamics = False
counts = get_counts(elements_ordered)
if "T" in "".join(map(str, self.atoms.props[0])):
middle = (
" ".join(map(str, counts.keys()))
+ "\n"
+ " ".join(map(str, counts.values()))
+ "\nSelective dynamics\n"
+ "Direct\n"
)
else:
middle = (
" ".join(map(str, counts.keys()))
+ "\n"
+ " ".join(map(str, counts.values()))
+ "\ndirect\n"
)
rest = ""
# print ('repr',self.frac_coords, self.frac_coords.shape)
for ii, i in enumerate(coords_ordered):
p_ordered = str(props_ordered[ii])
rest = (
rest + " ".join(map(str, i)) + " " + str(p_ordered) + "\n"
)

result = header + middle + rest
result = header + middle + rest

f.write(result)
f.close()
f.write(result)
# f.close()

@staticmethod
def from_string(lines):
Expand Down
1 change: 1 addition & 0 deletions jarvis/tasks/qe/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Module to run QE jobs."""
Loading

0 comments on commit b48e113

Please sign in to comment.