Skip to content

ASE-ABACUS cannot recognize the mag angle1 angle2 in STRU file #4203

@xdzhu

Description

@xdzhu

Describe the bug

It seems that ASE-ABACUS cannot recognize the mag angle1 angle2 case. It should be noticed that the angle1 and angle2 are set in xyz axes but NOT in abc axes.

@1041176461 Please consider adding the support of this case. (I cannot sign up the Gitlab account so I submit issue here....)

(icu) [zhuxd@mu01 angle-read]$ python read-stru.py
/home/zhuxd/Software/anaconda3/envs/icu/lib/python3.10/site-packages/ase/io/abacus.py:776: UserWarning: Non-colinear angle-settings are not yet supported for this interface.
warnings.warn(
Traceback (most recent call last):
File "/home/zhuxd/abacus/LZ/1.hse-AHC/Fe/angle-read/read-stru.py", line 3, in
atoms = read('STRU', format='abacus')
File "/home/zhuxd/Software/anaconda3/envs/icu/lib/python3.10/site-packages/ase/io/formats.py", line 801, in read
return next(_iread(filename, slice(index, None), format, io,
File "/home/zhuxd/Software/anaconda3/envs/icu/lib/python3.10/site-packages/ase/parallel.py", line 285, in new_generator
for result in generator(*args, **kwargs):
File "/home/zhuxd/Software/anaconda3/envs/icu/lib/python3.10/site-packages/ase/io/formats.py", line 868, in _iread
for dct in io.read(fd, *args, **kwargs):
File "/home/zhuxd/Software/anaconda3/envs/icu/lib/python3.10/site-packages/ase/io/formats.py", line 622, in wrap_read_function
yield read(filename, **kwargs)
File "/home/zhuxd/Software/anaconda3/envs/icu/lib/python3.10/site-packages/ase/utils/init.py", line 487, in iofunc
obj = func(fd, *args, **kwargs)
File "/home/zhuxd/Software/anaconda3/envs/icu/lib/python3.10/site-packages/ase/io/abacus.py", line 782, in read_abacus
m_index + 1:m_index + 4].astype(float)
ValueError: could not convert string to float: 'angle1'

Expected behavior

No response

To Reproduce

  1. write a STRU file like:

ATOMIC_SPECIES
Fe 55.845 Fe.upf

LATTICE_CONSTANT
1.889726125457828

LATTICE_VECTORS
1.4349959999999999 1.4349959999999999 1.4349959999999999
-1.4349959999999999 1.4349959999999999 1.4349959999999999
-1.4349959999999999 -1.4349959999999999 1.4349959999999999

ATOMIC_POSITIONS
Direct

Fe
0.000
1
0.000000000000 0.000000000000 0.000000000000 1 1 1 mag 2.31 angle1 90 angle2 0

  1. run python:

from ase.io import read, write

atoms = read('STRU', format='abacus')
print(atoms)

Environment

No response

Additional Context

No response

Task list for Issue attackers (only for developers)

  • Verify the issue is not a duplicate.
  • Describe the bug.
  • Steps to reproduce.
  • Expected behavior.
  • Error message.
  • Environment details.
  • Additional context.
  • Assign a priority level (low, medium, high, urgent).
  • Assign the issue to a team member.
  • Label the issue with relevant tags.
  • Identify possible related issues.
  • Create a unit test or automated test to reproduce the bug (if applicable).
  • Fix the bug.
  • Test the fix.
  • Update documentation (if necessary).
  • Close the issue and inform the reporter (if applicable).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Input&OutputSuitable for coders without knowing too many DFT details

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions