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

Adding a function that could deal with the magnetic_force and spin when using the ABACUS's deltaspin module #657

Closed
wants to merge 126 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
d031d8a
Update scf.py
RenguangLiu May 15, 2024
2640f22
Update comp.py
RenguangLiu May 15, 2024
bda3de0
Create dependency_links.txt
RenguangLiu May 15, 2024
139dd20
Create PKG-INFO
RenguangLiu May 15, 2024
3ffb7c2
Revert "Create dependency_links.txt"
RenguangLiu May 15, 2024
3aecdd7
Revert "Create PKG-INFO"
RenguangLiu May 15, 2024
22b12f0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 15, 2024
d69452e
Update scf.py
RenguangLiu May 15, 2024
f1b26b6
Update comp.py
RenguangLiu May 15, 2024
85f57fb
Merge branch 'my-fix-branch' of https://github.com/flinky-ai/dpdata i…
RenguangLiu May 15, 2024
cea87b0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 15, 2024
17d3c22
Update scf.py
RenguangLiu May 15, 2024
dd308d0
Update comp.py
RenguangLiu May 15, 2024
9cb65c6
Merge branch 'my-fix-branch' of https://github.com/flinky-ai/dpdata i…
RenguangLiu May 15, 2024
de64d1c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 15, 2024
ce3d4b3
Update scf.py
RenguangLiu May 15, 2024
9cd9d81
Update scf.py
RenguangLiu May 15, 2024
f179751
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 15, 2024
f9f4876
Update comp.py
RenguangLiu May 15, 2024
e1f02fd
Merge branch 'my-fix-branch' of https://github.com/flinky-ai/dpdata i…
RenguangLiu May 15, 2024
11603d3
Update scf.py
RenguangLiu May 20, 2024
e292c83
Update system.py
RenguangLiu May 20, 2024
4e81bb6
Create dependency_links.txt
RenguangLiu May 20, 2024
ecd6c25
Create PKG-INFO
RenguangLiu May 20, 2024
0fdf461
Create SOURCES.txt
RenguangLiu May 20, 2024
0290fc7
Create top_level.txt
RenguangLiu May 20, 2024
f7340d8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 20, 2024
0d9fb2b
Delete dependency_links.txt
RenguangLiu May 20, 2024
49b5edb
Delete PKG-INFO
RenguangLiu May 20, 2024
4db5ccd
Delete SOURCES.txt
RenguangLiu May 20, 2024
5255275
Delete top_level.txt
RenguangLiu May 20, 2024
65231d4
Update system.py
RenguangLiu May 20, 2024
03df336
Merge branch 'devel' into my-fix-branch
RenguangLiu May 20, 2024
e252b51
update
RenguangLiu May 20, 2024
0fbe9c3
For rebasing to the devel
May 20, 2024
546c4b0
Update scf.py
RenguangLiu May 15, 2024
00fa468
Update comp.py
RenguangLiu May 15, 2024
2193bc1
Create dependency_links.txt
RenguangLiu May 15, 2024
be33874
Create PKG-INFO
RenguangLiu May 15, 2024
6df967d
Revert "Create dependency_links.txt"
RenguangLiu May 15, 2024
dd39ee5
Revert "Create PKG-INFO"
RenguangLiu May 15, 2024
e90c9f6
Update scf.py
RenguangLiu May 15, 2024
3572431
Update comp.py
RenguangLiu May 15, 2024
ca092cb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 15, 2024
3733cd7
Update scf.py
RenguangLiu May 15, 2024
bb34f0e
Update comp.py
RenguangLiu May 15, 2024
45ea1a7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 15, 2024
5c56724
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 15, 2024
d7f132a
Update scf.py
RenguangLiu May 15, 2024
db86cf9
Update scf.py
RenguangLiu May 15, 2024
7a0815b
Update comp.py
RenguangLiu May 15, 2024
7beb60d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 15, 2024
7404dcf
Update scf.py
RenguangLiu May 20, 2024
694a3c7
Update system.py
RenguangLiu May 20, 2024
575daca
Create dependency_links.txt
RenguangLiu May 20, 2024
28be0c4
Create PKG-INFO
RenguangLiu May 20, 2024
86bf7e5
Create SOURCES.txt
RenguangLiu May 20, 2024
13437a3
Create top_level.txt
RenguangLiu May 20, 2024
a055802
Delete dependency_links.txt
RenguangLiu May 20, 2024
4dc19f5
Delete PKG-INFO
RenguangLiu May 20, 2024
e87be36
Delete SOURCES.txt
RenguangLiu May 20, 2024
a7831a3
Delete top_level.txt
RenguangLiu May 20, 2024
df5cbde
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 20, 2024
230887d
update
RenguangLiu May 20, 2024
fe24447
For rebasing to the devel
May 20, 2024
0e41ebb
Merge branch 'my-fix-branch' of https://github.com/flinky-ai/dpdata i…
May 20, 2024
9373272
Create dependency_links.txt
RenguangLiu May 15, 2024
2e35cd3
Create PKG-INFO
RenguangLiu May 15, 2024
cb82071
Revert "Create dependency_links.txt"
RenguangLiu May 15, 2024
e6d487d
Revert "Create PKG-INFO"
RenguangLiu May 15, 2024
f27d43a
Update scf.py
RenguangLiu May 15, 2024
36fbc2e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 15, 2024
472e8dd
Update scf.py
RenguangLiu May 15, 2024
d5c2acd
Update comp.py
RenguangLiu May 15, 2024
cf5583a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 15, 2024
e176e9e
Create dependency_links.txt
RenguangLiu May 20, 2024
bc8d037
Create PKG-INFO
RenguangLiu May 20, 2024
7646799
Create SOURCES.txt
RenguangLiu May 20, 2024
8fa43da
Create top_level.txt
RenguangLiu May 20, 2024
75e2c0c
Delete dependency_links.txt
RenguangLiu May 20, 2024
b88f24c
Delete PKG-INFO
RenguangLiu May 20, 2024
331e636
Delete SOURCES.txt
RenguangLiu May 20, 2024
48828c8
Delete top_level.txt
RenguangLiu May 20, 2024
081a2e5
update
RenguangLiu May 20, 2024
6bc6b33
For rebasing to the devel
May 20, 2024
71dacf5
Merge branch 'my-fix-branch' of https://github.com/flinky-ai/dpdata i…
RenguangLiu May 20, 2024
929702b
Create dependency_links.txt
RenguangLiu May 15, 2024
6d592ae
Create PKG-INFO
RenguangLiu May 15, 2024
f5481f8
Revert "Create dependency_links.txt"
RenguangLiu May 15, 2024
d75684f
Revert "Create PKG-INFO"
RenguangLiu May 15, 2024
4d3ca3e
Update scf.py
RenguangLiu May 15, 2024
f294072
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 15, 2024
d893017
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 15, 2024
5bef166
Update scf.py
RenguangLiu May 15, 2024
e54bfc2
Update comp.py
RenguangLiu May 15, 2024
1e471fa
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 15, 2024
5143f43
Update scf.py
RenguangLiu May 20, 2024
2411840
Create dependency_links.txt
RenguangLiu May 20, 2024
3bbec17
Create PKG-INFO
RenguangLiu May 20, 2024
5738c08
Create SOURCES.txt
RenguangLiu May 20, 2024
a26adae
Create top_level.txt
RenguangLiu May 20, 2024
4917e91
Delete dependency_links.txt
RenguangLiu May 20, 2024
0451d81
Delete PKG-INFO
RenguangLiu May 20, 2024
99c44e2
Delete SOURCES.txt
RenguangLiu May 20, 2024
3b5266c
Delete top_level.txt
RenguangLiu May 20, 2024
1acafd4
For rebasing to the devel
May 20, 2024
43aabf8
Merge branch 'my-fix-branch' of https://github.com/flinky-ai/dpdata i…
RenguangLiu May 20, 2024
814a6a9
add the deltaspin test unit
RenguangLiu May 20, 2024
1a49e2c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 20, 2024
303f63b
Update test_abacus_deltaspin.py
RenguangLiu May 20, 2024
fe844e3
Merge branch 'my-fix-branch' of https://github.com/flinky-ai/dpdata i…
RenguangLiu May 20, 2024
569e58a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 20, 2024
48480a4
Update scf.py
RenguangLiu May 20, 2024
29c4b76
Update system.py
RenguangLiu May 20, 2024
fbfd3f7
Update test_abacus_deltaspin.py
RenguangLiu May 20, 2024
cdb3849
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 20, 2024
fdc5d3f
Update test_abacus_deltaspin.py
RenguangLiu May 20, 2024
37795f5
Merge branch 'my-fix-branch' of https://github.com/flinky-ai/dpdata i…
RenguangLiu May 20, 2024
32d2fe9
unittest for deltaspin
RenguangLiu May 21, 2024
0e27ad1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 21, 2024
ad1623f
Update test_abacus_deltaspin.py
RenguangLiu May 21, 2024
96c74a2
Merge branch 'my-fix-branch' of https://github.com/flinky-ai/dpdata i…
RenguangLiu May 21, 2024
12dcb8f
Merge branch 'devel' into my-fix-branch
njzjz May 22, 2024
42452af
change into LF
RenguangLiu May 23, 2024
7ee3f1e
Normalize all the line endings
May 23, 2024
361b293
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 23, 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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.git_archival.txt export-subst
*.py test eol=lf
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.analysis.typeCheckingMode": "basic"
}
101 changes: 101 additions & 0 deletions dpdata/abacus/scf.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,31 @@
return Etot, False


def get_magnetic(outlines, natoms):
Mag = []

Check warning on line 163 in dpdata/abacus/scf.py

View check run for this annotation

Codecov / codecov/patch

dpdata/abacus/scf.py#L163

Added line #L163 was not covered by tests

# regular expression
mag_pattern = re.compile(

Check warning on line 166 in dpdata/abacus/scf.py

View check run for this annotation

Codecov / codecov/patch

dpdata/abacus/scf.py#L166

Added line #L166 was not covered by tests
r"Total Magnetism on atom:.*\(([\d.\-]+),\s*([\d.\-]+),\s*([\d.\-]+)\)"
)

for line in outlines:

Check warning on line 170 in dpdata/abacus/scf.py

View check run for this annotation

Codecov / codecov/patch

dpdata/abacus/scf.py#L170

Added line #L170 was not covered by tests
# match the magnetic information with regular expression
match = mag_pattern.search(line)
if match:

Check warning on line 173 in dpdata/abacus/scf.py

View check run for this annotation

Codecov / codecov/patch

dpdata/abacus/scf.py#L172-L173

Added lines #L172 - L173 were not covered by tests
# Transit to float, and append to the list
Mag.append([float(num) for num in match.groups()])

Check warning on line 175 in dpdata/abacus/scf.py

View check run for this annotation

Codecov / codecov/patch

dpdata/abacus/scf.py#L175

Added line #L175 was not covered by tests
# If the lense of the Mag equal to 'natoms', all the magnetic moments collected
if len(Mag) == natoms:
break

Check warning on line 178 in dpdata/abacus/scf.py

View check run for this annotation

Codecov / codecov/patch

dpdata/abacus/scf.py#L177-L178

Added lines #L177 - L178 were not covered by tests

# If no magnetic information found return an empty NumPy array
if len(Mag) == 0:
return np.array([[]])

Check warning on line 182 in dpdata/abacus/scf.py

View check run for this annotation

Codecov / codecov/patch

dpdata/abacus/scf.py#L181-L182

Added lines #L181 - L182 were not covered by tests
else:
return np.array(Mag)

Check warning on line 184 in dpdata/abacus/scf.py

View check run for this annotation

Codecov / codecov/patch

dpdata/abacus/scf.py#L184

Added line #L184 was not covered by tests


def collect_force(outlines):
force = []
for i, line in enumerate(outlines):
Expand Down Expand Up @@ -195,6 +220,42 @@
return np.array(force[-1]) # only return the last force


def collect_mag_force(outlines):
mag_force = []
for i, line in enumerate(outlines):
if "Magnetic force (Ry/uB)" in line:
value_pattern = re.compile(

Check warning on line 227 in dpdata/abacus/scf.py

View check run for this annotation

Codecov / codecov/patch

dpdata/abacus/scf.py#L224-L227

Added lines #L224 - L227 were not covered by tests
r"^\s*ATOM\s+(\d+)\s+[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?\s+[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?\s+[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?\s*$"
)
j = i

Check warning on line 230 in dpdata/abacus/scf.py

View check run for this annotation

Codecov / codecov/patch

dpdata/abacus/scf.py#L230

Added line #L230 was not covered by tests
# find the first line of force
noforce = False
while not value_pattern.match(outlines[j]):
j += 1
if (

Check warning on line 235 in dpdata/abacus/scf.py

View check run for this annotation

Codecov / codecov/patch

dpdata/abacus/scf.py#L232-L235

Added lines #L232 - L235 were not covered by tests
j >= i + 10
): # if can not find the first line of force in 10 lines, then stop
warnings.warn("Warning: can not find the first line of force")
noforce = True
break
if noforce:
break

Check warning on line 242 in dpdata/abacus/scf.py

View check run for this annotation

Codecov / codecov/patch

dpdata/abacus/scf.py#L238-L242

Added lines #L238 - L242 were not covered by tests

mag_force.append([])
while value_pattern.match(outlines[j]):
mag_force[-1].append([float(ii) for ii in outlines[j].split()[1:4]])
j += 1
return mag_force # only return the last force

Check warning on line 248 in dpdata/abacus/scf.py

View check run for this annotation

Codecov / codecov/patch

dpdata/abacus/scf.py#L244-L248

Added lines #L244 - L248 were not covered by tests


def get_mag_force(outlines, natoms):
mag_force = collect_mag_force(outlines)
if len(mag_force) == 0:
return [[]]

Check warning on line 254 in dpdata/abacus/scf.py

View check run for this annotation

Codecov / codecov/patch

dpdata/abacus/scf.py#L252-L254

Added lines #L252 - L254 were not covered by tests
else:
return np.array(mag_force[-1]) # only return the last force

Check warning on line 256 in dpdata/abacus/scf.py

View check run for this annotation

Codecov / codecov/patch

dpdata/abacus/scf.py#L256

Added line #L256 was not covered by tests


def collect_stress(outlines):
stress = []
for i, line in enumerate(outlines):
Expand Down Expand Up @@ -232,6 +293,21 @@
return np.array(stress[-1]) * kbar2evperang3 # only return the last stress


def check_deltaspin(path_in):
try:
with open(path_in) as file:
for line in file:
parts = line.strip().split()
# Check if the "sc_mag_switch" exist
if len(parts) >= 2 and parts[0] == "sc_mag_switch":
return True if parts[1] == "1" else None

Check warning on line 303 in dpdata/abacus/scf.py

View check run for this annotation

Codecov / codecov/patch

dpdata/abacus/scf.py#L303

Added line #L303 was not covered by tests
# if "sc_mag_switch" not exist return None
return None
except FileNotFoundError:
print(f"File not found: {path_in}")
return None

Check warning on line 308 in dpdata/abacus/scf.py

View check run for this annotation

Codecov / codecov/patch

dpdata/abacus/scf.py#L306-L308

Added lines #L306 - L308 were not covered by tests


def get_frame(fname):
data = {
"atom_names": [],
Expand All @@ -241,6 +317,11 @@
"coords": [],
"energies": [],
"forces": [],
"spin": [],
"mag_forces": [],
"coords_deltaspin": [],
"force_deltaspin": [],
"deltaspin": [],
}

if isinstance(fname, str):
Expand All @@ -258,6 +339,7 @@

geometry_path_in = get_geometry_in(fname, inlines)
path_out = get_path_out(fname, inlines)
deltaspin = check_deltaspin(path_in)
if not (CheckFile(geometry_path_in) and CheckFile(path_out)):
return data

Expand All @@ -282,10 +364,25 @@
if stress is not None:
stress *= np.abs(np.linalg.det(cell))

if deltaspin is not None:
spin = get_magnetic(outlines, natoms)
sp_norm = 1.49
virtual_len = 0.3
mag_forces = get_mag_force(outlines, natoms)
coords_deltaspin = np.hstack((coords, coords - spin / sp_norm * virtual_len))
force_deltaspin = np.hstack((force, mag_forces))

Check warning on line 373 in dpdata/abacus/scf.py

View check run for this annotation

Codecov / codecov/patch

dpdata/abacus/scf.py#L368-L373

Added lines #L368 - L373 were not covered by tests

data["cells"] = cell[np.newaxis, :, :]
data["coords"] = coords[np.newaxis, :, :]
data["energies"] = np.array(energy)[np.newaxis]
data["forces"] = force[np.newaxis, :, :]
if deltaspin is not None:
data["mag_forces"] = mag_forces[np.newaxis, :, :]
data["spin"] = spin[np.newaxis, :, :]
data["coords_deltaspin"] = coords_deltaspin[np.newaxis, :, :]
data["force_deltaspin"] = force_deltaspin[np.newaxis, :, :]
data["deltaspin"] = deltaspin

Check warning on line 384 in dpdata/abacus/scf.py

View check run for this annotation

Codecov / codecov/patch

dpdata/abacus/scf.py#L380-L384

Added lines #L380 - L384 were not covered by tests
Comment on lines +380 to +384
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still, these data types should be added to DTYPES, otherwise I don't think indexing, slicing, or appending will work.

dpdata/dpdata/system.py

Lines 1193 to 1198 in 1d87e82

DTYPES: tuple[DataType, ...] = System.DTYPES + (
DataType("energies", np.ndarray, (Axis.NFRAMES,)),
DataType("forces", np.ndarray, (Axis.NFRAMES, Axis.NATOMS, 3)),
DataType("virials", np.ndarray, (Axis.NFRAMES, 3, 3), required=False),
DataType("atom_pref", np.ndarray, (Axis.NFRAMES, Axis.NATOMS), required=False),
)


if stress is not None:
data["virials"] = stress[np.newaxis, :, :]
data["orig"] = np.zeros(3)
Expand All @@ -297,6 +394,10 @@
# print("energy = ", data['energies'])
# print("force = ", data['forces'])
# print("virial = ", data['virials'])
# print("spin = ", data['spin'])
# print("mag_forces = ", data['mag_forces'])
# print("force_deltaspin = ", data['force_deltaspin'])
# print("coords_deltaspin = ", data['coords_deltaspin'])
Comment on lines +397 to +400
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented codes should be removed

return data


Expand Down
29 changes: 27 additions & 2 deletions dpdata/deepmd/comp.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,25 @@
nframes = data["cells"].shape[0]
cells = np.reshape(data["cells"], [nframes, 9]).astype(comp_prec)
coords = np.reshape(data["coords"], [nframes, -1]).astype(comp_prec)
if "coords_deltaspin" in data:
coords_deltaspin = np.reshape(data["coords_deltaspin"], [nframes, -1]).astype(

Check warning on line 139 in dpdata/deepmd/comp.py

View check run for this annotation

Codecov / codecov/patch

dpdata/deepmd/comp.py#L139

Added line #L139 was not covered by tests
comp_prec
)
eners = None
forces = None
virials = None
force_deltaspin = None
deltaspin = None
if "deltaspin" in data:
deltaspin = data["deltaspin"]

Check warning on line 148 in dpdata/deepmd/comp.py

View check run for this annotation

Codecov / codecov/patch

dpdata/deepmd/comp.py#L148

Added line #L148 was not covered by tests
if "energies" in data:
eners = np.reshape(data["energies"], [nframes]).astype(comp_prec)
if "forces" in data:
forces = np.reshape(data["forces"], [nframes, -1]).astype(comp_prec)
if "force_deltaspin" in data:
force_deltaspin = np.reshape(data["force_deltaspin"], [nframes, -1]).astype(

Check warning on line 154 in dpdata/deepmd/comp.py

View check run for this annotation

Codecov / codecov/patch

dpdata/deepmd/comp.py#L154

Added line #L154 was not covered by tests
comp_prec
)
if "virials" in data:
virials = np.reshape(data["virials"], [nframes, 9]).astype(comp_prec)
if "atom_pref" in data:
Expand All @@ -156,11 +168,21 @@
set_folder = os.path.join(folder, "set.%03d" % ii)
os.makedirs(set_folder)
np.save(os.path.join(set_folder, "box"), cells[set_stt:set_end])
np.save(os.path.join(set_folder, "coord"), coords[set_stt:set_end])
if deltaspin is not None:
np.save(

Check warning on line 172 in dpdata/deepmd/comp.py

View check run for this annotation

Codecov / codecov/patch

dpdata/deepmd/comp.py#L172

Added line #L172 was not covered by tests
os.path.join(set_folder, "coord"), coords_deltaspin[set_stt:set_end]
)
else:
np.save(os.path.join(set_folder, "coord"), coords[set_stt:set_end])
if eners is not None:
np.save(os.path.join(set_folder, "energy"), eners[set_stt:set_end])
if forces is not None:
np.save(os.path.join(set_folder, "force"), forces[set_stt:set_end])
if deltaspin is not None:
np.save(

Check warning on line 181 in dpdata/deepmd/comp.py

View check run for this annotation

Codecov / codecov/patch

dpdata/deepmd/comp.py#L181

Added line #L181 was not covered by tests
os.path.join(set_folder, "force"), force_deltaspin[set_stt:set_end]
)
else:
np.save(os.path.join(set_folder, "force"), forces[set_stt:set_end])
if virials is not None:
np.save(os.path.join(set_folder, "virial"), virials[set_stt:set_end])
if "atom_pref" in data:
Expand All @@ -187,6 +209,9 @@
"energies",
"forces",
"virials",
"force_deltaspin",
"coords_deltaspin",
"deltaspin",
):
# skip as these data contains specific rules
continue
Expand Down
29 changes: 29 additions & 0 deletions tests/abacus.scf.deltaspin/INPUT
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
INPUT_PARAMETERS
suffix ABACUS
calculation scf
ecutwfc 100
scf_thr 1.0e-7
scf_nmax 200
out_chg 0
smearing_method gauss
smearing_sigma 0.01
ks_solver genelpa
basis_type lcao
symmetry 0
noncolin 1
lspinorb 0
nspin 4
kspacing 1.0
cal_force true
cal_stress true
out_mul true

#deltaspin
sc_mag_switch 1
decay_grad_switch 1
sc_thr 1e-7
nsc 100
nsc_min 2
sc_file sc.json
alpha_trial 0.01
sccut 3
Loading