diff --git a/tests/test_parser.py b/tests/test_parser.py index 1143327..ba483bd 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -156,3 +156,97 @@ def test_single_point_La2CuO4(parser): assert output.electronic_band_structures[0].value[123, 0].to( 'eV' ).magnitude == approx(12.870674) + + +def test_minimal_Pt_Vikrant(parser): + archive = EntryArchive() + parser.parse( + os.path.join('tests', 'data', 'minimal_Pt_Vikrant', 'wannier90.wout'), + archive, + logger, + ) + simulation = archive.data + + # Program + assert simulation.program.name == 'Wannier90' + assert simulation.program.version == '3.1.0' + + # ModelSystem + assert len(simulation.model_system) == 1 + model_system = simulation.model_system[0] + assert model_system.is_representative + # Cell + assert len(model_system.cell) == 1 + atomic_cell = model_system.cell[0] + assert np.isclose( + atomic_cell.positions.to('angstrom').magnitude, + np.array( + [ + [0.0, 0.0, 0.0], + [0.0, 1.972, 1.972], + [1.972, 0.0, 1.972], + [1.972, 1.972, 0.0], + ] + ), + ).all() + assert np.isclose( + atomic_cell.lattice_vectors.to('angstrom').magnitude, + np.array([[3.944, 0.0, 0.0], [0.0, 3.944, 0.0], [0.0, 0.0, 3.944]]), + ).all() + assert atomic_cell.periodic_boundary_conditions == [True, True, True] + # AtomsState + assert len(atomic_cell.atoms_state) == 4 + for index, symbol in enumerate(['Pt', 'Pt', 'Pt', 'Pt']): + assert atomic_cell.atoms_state[index].chemical_symbol == symbol + # SubSystems + assert len(model_system.model_system) == 4 + for i, subsystem in enumerate(model_system.model_system): + assert subsystem.type == 'active_atom' + assert subsystem.branch_label == 'Pt' + assert (subsystem.atom_indices == [i]).all() + + # ModelMethod + assert len(simulation.model_method) == 1 + assert simulation.model_method[0].m_def.name == 'Wannier' + wannier = simulation.model_method[0] + assert wannier.is_maximally_localized + assert wannier.n_orbitals == 36 + assert wannier.n_bloch_bands == 240 + assert np.isclose(wannier.energy_window_inner.magnitude, [8.80301, 11.80301]).all() + assert np.isclose(wannier.energy_window_outer.magnitude, [0.32315, 36.58885]).all() + # NumericalSettings + assert len(wannier.numerical_settings) == 1 + assert wannier.numerical_settings[0].m_def.name == 'KSpace' + k_space = wannier.numerical_settings[0] + # KMesh + assert len(k_space.k_mesh) == 1 + assert k_space.k_mesh[0].n_points == 512 + assert np.isclose(k_space.k_mesh[0].grid, [8, 8, 8]).all() + # KLinePath + assert not k_space.m_xpath('k_line_path') + + # Outputs + assert len(simulation.outputs) == 1 + output = simulation.outputs[0] + assert output.model_system_ref == model_system + assert output.model_method_ref == wannier + # Properties + for property_name in ['crystal_field_splittings', 'hopping_matrices']: + assert output.m_xpath(property_name, dict=False) is not None + assert len(output.m_xpath(property_name, dict=False)) == 1 + # CrystalFieldSplitting + assert output.crystal_field_splittings[0].value[0].to('eV').magnitude == approx( + 11.966103 + ) + # HoppingMatrix + assert len(output.hopping_matrices[0].variables) == 1 + assert output.hopping_matrices[0].variables[0].m_def.name == 'WignerSeitz' + assert output.hopping_matrices[0].variables[0].n_points == 729 + assert output.hopping_matrices[0].value.shape == (729, 36, 36) + assert output.hopping_matrices[0].value[4, 0, 0].to('eV').magnitude == approx( + 0.000224 + 0j + ) + # ElectronicDOS + assert not output.m_xpath('electronic_dos') + # ElectronicBandStructure + assert not output.m_xpath('electronic_band_structures')