Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 13 additions & 0 deletions test/python/wien2k/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@ add_test(NAME Py_wien2k_convert
set_property(TEST Py_wien2k_convert APPEND PROPERTY ENVIRONMENT
PYTHONPATH=${PROJECT_BINARY_DIR}/python:$ENV{PYTHONPATH} ${SANITIZER_RT_PRELOAD})

# Spin-orbit + spin-polarized converter test (two equivalent Os atoms).
file(COPY CaOs2.ctqmcout CaOs2.symqmc CaOs2.struct CaOs2.outputs
CaOs2.oubwinup CaOs2.parproj
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
# dmftproj writes CaOs2.sympar byte-identical to CaOs2.symqmc for this fixture.
configure_file(CaOs2.symqmc ${CMAKE_CURRENT_BINARY_DIR}/CaOs2.sympar COPYONLY)

add_test(NAME Py_wien2k_soc_convert
COMMAND ${TRIQS_PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/wien2k_soc_convert.py
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
set_property(TEST Py_wien2k_soc_convert APPEND PROPERTY ENVIRONMENT
PYTHONPATH=${PROJECT_BINARY_DIR}/python:$ENV{PYTHONPATH} ${SANITIZER_RT_PRELOAD})

add_test(NAME Py_wien2k_kpath_labels
COMMAND ${TRIQS_PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_kpath_labels.py
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
Expand Down
81 changes: 81 additions & 0 deletions test/python/wien2k/CaOs2.README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# CaOs2 SOC converter fixture

This fixture covers spin-polarized spin-orbit coupling (`dmftproj -so -sp`),
two equivalent correlated Os d shells, and sixteen magnetic symmetry
operations, eight flagged antiunitary. The per-shell time-reversal matrices
are identity matrices and the local rotation time-reversal flags are zero;
this fixture does not cover nontrivial local time-reversal rotations.
The retained input contains one
k-point with unit normalized weight. It does not test variation over k-points.

The original narrow window (recorded in the stack inputs at `5a805f7`),
-0.15 to 0.30 Ry relative to the Fermi energy,
selected bands 60–76 and could not accommodate the twenty correlated spin
orbitals. The shipped `CaOs2.indmftpr` uses -2.0 to 3.0 Ry and selects bands
43–92 (50 bands). The native producer gives a full twenty-dimensional
correlated subspace: the maximum stacked projector overlap error is about
3.1e-8. The test checks this numerical invariant independently of the golden
archive, including overlaps between different shells. It also checks the
eight operations that exchange Os atoms and the unitarity of the shell
symmetry matrices.

`convert_parproj_input` is covered as well: `CaOs2.parproj` holds two radial
partial projectors per Os d shell, and the test checks their rotation
matrices, the Hermiticity of the density matrix below the window and the
equivalence of the two Os shells. The partial shells coincide with the
correlated shells, so dmftproj writes a `CaOs2.sympar` byte-identical to
`CaOs2.symqmc`; CMake copies `CaOs2.symqmc` to `CaOs2.sympar` instead of
shipping a duplicate, and the test checks that the two symmetry groups agree.
`convert_transport_input` is not covered: it needs `case.pmat` from Wien2k
`optic`, which cannot be produced from the retained inputs.

## Producer provenance

The compressed `CaOs2.almblmup.gz` and `CaOs2.almblmdn.gz` are the retained
Wien2k projector inputs already used by the dmftproj port stack. Their
decompressed content matches commit
`5a805f74e37854ea0f4576e39516ce47fafa25e7`, which introduced those inputs.
The original Wien2k version, initialization commands, and parent k-mesh were
not retained; reproducing the underlying DFT calculation
is therefore outside this fixture's documented provenance. No new k-points
or projector coefficients have been constructed for this correction.

The files include the complete inputs needed to regenerate the converter
fixture with the native Fortran producer: the two `almblm` files, `struct`,
`dmftsym`, `indmftpr`, and retained `case.cf_d_eg_t2g` basis template. The
original cubic basis is preserved. The fixture was regenerated with the native
CMake producer (GNU Fortran 15.3.0) from upstream `43435dc`; the converter
reference uses TRIQS 4.0.2. Use the producer built from this repository:

```sh
mkdir -p wienroot/SRC_templates CaOs2
cp /path/to/fixtures/case.cf_d_eg_t2g wienroot/SRC_templates/
export WIENROOT="$PWD/wienroot"
cd CaOs2
# Copy CaOs2.struct, CaOs2.dmftsym, CaOs2.indmftpr and CaOs2.outputs here.
gzip -dc /path/to/fixtures/CaOs2.almblmup.gz > CaOs2.almblmup
gzip -dc /path/to/fixtures/CaOs2.almblmdn.gz > CaOs2.almblmdn
/path/to/build/fortran/dmftproj/dmftproj -so -sp
```

The directory must be named `CaOs2`, since dmftproj derives the case name from
the working directory. Retain the resulting `.ctqmcout`, `.symqmc`,
`.parproj` and `.oubwinup`; `.oubwindn` is identical and the SOC converter
reads `.oubwinup`, and `.sympar` is identical to `.symqmc`.
Only trailing whitespace is removed from native text output.
The original `.struct` and `.outputs` supply the converter's miscellaneous
symmetry data. Regenerate the HDF reference with the same installed converter:

```python
from triqs_dftkit.wien2k import Converter
converter = Converter(filename='CaOs2')
converter.hdf_file = 'wien2k_soc_convert.ref.h5'
converter.convert_dft_input()
converter.convert_parproj_input()
```

The archive comparison checks every entry at an absolute tolerance of `1e-12`
for conversion of the same fixture bytes. It does not use
`triqs.utility.h5diff`, which compares arrays at `1e-6` regardless of its
`precision` argument. The physical overlap check uses `1e-6` because the
retained Wien2k inputs and native text output have finite precision.
Binary file added test/python/wien2k/CaOs2.almblmdn.gz
Binary file not shown.
Binary file added test/python/wien2k/CaOs2.almblmup.gz
Binary file not shown.
Loading
Loading