Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partial charges and stm #144

Merged
merged 61 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
faccb92
started to implement partial charges.
MichaelWolloch Feb 13, 2024
7de89b0
Merge remote-tracking branch 'origin/master' into partial_charges_and…
MichaelWolloch Feb 13, 2024
d244700
Merge remote-tracking branch 'origin/master' into partial_charges_and…
MichaelWolloch Feb 13, 2024
75de62d
Small typo fixed in the schema, added 'partial_charge' to the __init_…
MichaelWolloch Feb 26, 2024
5abfa06
Merge branch 'vasp-dev:master' into partial_charges_and_STM
MichaelWolloch Feb 28, 2024
9455876
first version of partial_charge class. Still no tests.
MichaelWolloch Feb 28, 2024
862b83d
running black and isort
MichaelWolloch Feb 28, 2024
4da95c3
Cleaned up the STM_data class.
MichaelWolloch Mar 1, 2024
2ce734b
Adding the unit tests for real now...
MichaelWolloch Mar 1, 2024
8081576
Slight cleanup, added docstrings, and a couple more tests.
MichaelWolloch Mar 5, 2024
6a10e4f
changed current units to nA and constant current no outputs correct h…
MichaelWolloch Mar 7, 2024
9daf282
Fixed test for constant-current after changing the input units.
MichaelWolloch Mar 11, 2024
f58354f
Add basic Contour class
martin-schlipf Mar 12, 2024
ca664a9
Add Contour to Graph infrastructure
martin-schlipf Mar 12, 2024
19e5490
Implement basic rectangular heatmap
martin-schlipf Mar 12, 2024
993dd31
Implement supercell for Heatmap
martin-schlipf Mar 12, 2024
58485af
Add label from Contour to plotly figure
martin-schlipf Mar 12, 2024
11c8a9f
Hide axes if only Contour are present
martin-schlipf Mar 12, 2024
d3169ef
Implement interpolation
martin-schlipf Mar 12, 2024
f1ad337
Put schema and dataclass in alphabetical order.
MichaelWolloch Mar 12, 2024
2bf6fd9
Removed old plotting and implemented graph.Graph.
MichaelWolloch Mar 12, 2024
7d706c4
Implement drawing the unit cell
martin-schlipf Mar 12, 2024
ccda056
Merge remote-tracking branch 'origin/stm' into partial_charges_and_STM
MichaelWolloch Mar 12, 2024
4a530f3
Fix transpose of data w.r.t. plotly
martin-schlipf Mar 13, 2024
0cba8d8
Make plot look prettier by using same scale for axes
martin-schlipf Mar 13, 2024
9155c6c
Merge remote-tracking branch 'origin/stm' into partial_charges_and_STM
MichaelWolloch Mar 13, 2024
d00d5e7
Fix plotting supercell with interpolation
martin-schlipf Mar 13, 2024
be5f96e
Choose different default colorscale
martin-schlipf Mar 13, 2024
63d9297
Merge remote-tracking branch 'origin/stm' into partial_charges_and_STM
MichaelWolloch Mar 13, 2024
3416766
Fixed bug with passing also z component of first two lattice vectors …
MichaelWolloch Mar 13, 2024
43a7cf2
fixed test as well
MichaelWolloch Mar 13, 2024
2d9b77f
removed testing functions
MichaelWolloch Mar 13, 2024
6d7e759
Add documentation to Contour class
martin-schlipf Mar 14, 2024
780f775
Introduce a base class to define the API Graph uses
martin-schlipf Mar 14, 2024
fe87bb9
Add test combining Contour and Series
martin-schlipf Mar 14, 2024
4a8602a
Merge remote-tracking branch 'origin/stm' into partial_charges_and_STM
MichaelWolloch Mar 14, 2024
dac38b9
set the height of contour plots to 500 to make STM pics larger
MichaelWolloch Mar 14, 2024
ff143a0
Fix formatting
martin-schlipf Mar 14, 2024
920974e
Rename mode to selection for consistency with other classes
martin-schlipf Mar 14, 2024
d0274d9
Remove undocumented/untested squeeze option from read
martin-schlipf Mar 14, 2024
b0eb93c
Make STM settings immutable
martin-schlipf Mar 14, 2024
ea15e4b
Use select Tree for selection in partial charge
martin-schlipf Mar 14, 2024
7781c08
Rename to_array -> to_numpy and use selection instead of spin
martin-schlipf Mar 14, 2024
161b99f
Refactor to make code more compact
martin-schlipf Mar 14, 2024
c72cbdd
Refactor partial charge
martin-schlipf Mar 15, 2024
3ad5197
Refactor spline construction
martin-schlipf Mar 15, 2024
a33a05e
Refactor test
martin-schlipf Mar 15, 2024
bfac8ea
Fix data access decorators
martin-schlipf Mar 15, 2024
3614343
Capitalize STM
martin-schlipf Mar 15, 2024
ee6ff90
Update dependencies for scipy
martin-schlipf Mar 15, 2024
78f3c3f
Make scipy optional
martin-schlipf Mar 15, 2024
516bfdb
corrected format label for constant current scans.
MichaelWolloch Mar 20, 2024
40660e2
now printing current in nA. Had forget to change that in the tests.
MichaelWolloch Apr 12, 2024
4288ad1
Changed the implementation so that also non-orthogonal z-axis are all…
MichaelWolloch May 15, 2024
eef83b0
Merge remote-tracking branch 'origin/master' into partial_charges_and…
MichaelWolloch May 16, 2024
e56f041
fixes of merge conflicts
MichaelWolloch May 16, 2024
5e476b7
fixed lattice plane passing to contour and updated tests accordingly
MichaelWolloch May 16, 2024
bdc8f4a
updated cc height difference to be measured in Angstrom; relative to …
MichaelWolloch May 16, 2024
fce96d0
fixed poetry.lock that I apparently broke at some point
MichaelWolloch May 16, 2024
4789c31
Using keyword only arguments for tip_height, current, and supercell a…
MichaelWolloch May 17, 2024
57f266a
Remove commented out old version of getting STM plane
MichaelWolloch May 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion core/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ authors = [
"Orest Dubay <[email protected]>",
"Jonathan Lahnsteiner <[email protected]>",
"Eisuke Kawashima <[email protected]>",
"Sudarshan Vijay <[email protected]>"
"Sudarshan Vijay <[email protected]>",
"Marie-Therese Huebsch <[email protected]>",
"Michael Wolloch <[email protected]>",
]
license = "Apache-2.0"
readme = "README.md"
Expand Down
133 changes: 69 additions & 64 deletions poetry.lock

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ authors = [
"Orest Dubay <[email protected]>",
"Jonathan Lahnsteiner <[email protected]>",
"Eisuke Kawashima <[email protected]>",
"Sudarshan Vijay <[email protected]>"
"Sudarshan Vijay <[email protected]>",
"Marie-Therese Huebsch <[email protected]>",
"Michael Wolloch <[email protected]>",
]
license = "Apache-2.0"
readme = "README.md"
Expand All @@ -30,6 +32,7 @@ ase = ">=3.22.1"
plotly = ">=5.9.0"
kaleido = ">=0.2.1,<0.2.1.post1 || >0.2.1.post1"
ipython = ">=8.12"
scipy = ">=1.12.0"

[tool.poetry.group.dev.dependencies]
pytest = ">=7.1.2"
Expand Down
18 changes: 18 additions & 0 deletions src/py4vasp/_raw/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,24 @@ class PairCorrelation:
"Describes which indices correspond to which element pair."


@dataclasses.dataclass
class PartialCharge:
"""Electronic partial charge and magnetization density on the fine Fourier grid

Possibly not only split by spin, but also by band and kpoint."""

structure: Structure
"The atomic structure to represent the densities."
partial_charge: VaspData
"The data of electronic charge and magnetization density."
kpoints: VaspData
"The kpoints at which the partial charge is evaluated."
bands: VaspData
"The bands at which the partial charge is evaluated."
grid: VaspData
"The fine FFT grid at which the partial charge is evaluated."


@dataclasses.dataclass
class PhononBand:
"""The band structure of the phonons.
Expand Down
10 changes: 10 additions & 0 deletions src/py4vasp/_raw/definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,16 @@ def selections(quantity):
labels=f"{group}/labels",
)
#
schema.add(
raw.PartialCharge,
required=raw.Version(6, 5),
structure=Link("structure", DEFAULT_SOURCE),
partial_charge="results/partial_charges/parchg",
bands="results/partial_charges/bands",
kpoints="results/partial_charges/kpoints",
grid="results/partial_charges/grid",
)
#
group = "results/phonons"
schema.add(
raw.PhononBand,
Expand Down
7 changes: 4 additions & 3 deletions src/py4vasp/_third_party/graph/contour.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ class Contour(trace.Trace):
the dimensions should be the ones of the grid, if the data is 3d the first dimension
should be a 2 for a vector in the plane of the grid and the other two dimensions
should be the grid."""
lattice: Lattice
"""2 vectors spanning the plane in which the data is represented. Each vector should
have two components, so remove any element normal to the plane."""
lattice: Plane
"""Lattice plane in which the data is represented spanned by 2 vectors.
Each vector should have two components, so remove any element normal to
the plane. Can be generated with the 'plane' function in py4vasp._util.slicing."""
label: str
"Assign a label to the visualization that may be used to identify one among multiple plots."
isolevels: bool = False
Expand Down
1 change: 1 addition & 0 deletions src/py4vasp/calculation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class provides a more flexible interface with which you can determine the source
"magnetism",
"OSZICAR",
"pair_correlation",
"partial_charge",
"phonon_band",
"phonon_dos",
"piezoelectric_tensor",
Expand Down
Loading