Author Topic: Dynamical matrix calculation stuck/doesn't run  (Read 1471 times)

0 Members and 1 Guest are viewing this topic.

Offline pk364

  • New QuantumATK user
  • *
  • Posts: 3
  • Country: de
  • Reputation: 0
    • View Profile
Dynamical matrix calculation stuck/doesn't run
« on: August 23, 2024, 10:13 »
Hello QATK staff, I am trying to run a dynamical matrix calculation for a simple crystal (La2CuO4 primitive) with 7 atoms. It's LCAO calculation converges and produces the expected band structure with the bands crossing the Fermi level at the correct crystal directions. However, when I use the converged calculation to compute the Dynamical Matrix, the calculation doesn't go forward and gets stuck at step 1/25. The Job Manager also shows strangely that the job is "finished" but the hdf5 file doesn't contain any Dynamical Matrix. It seems like people in this forum have encountered long calculation times for the Dynamical Matrix but in my case, the calculation itself just stops and doesn't move forward. The codes are as follows: Part1 - LCAO calculation and bandstructure (success)
Code
# -*- coding: utf-8 -*-
# -------------------------------------------------------------
# Bulk Configuration
# -------------------------------------------------------------

# Set up lattice
lattice = BodyCenteredTetragonal(3.813804*Angstrom, 13.224902*Angstrom)

# Define elements
elements = [Lanthanum, Lanthanum, Copper, Oxygen, Oxygen, Oxygen, Oxygen]

# Define coordinates
fractional_coordinates = [[ 0.360893,  0.360893,  0.      ],
                          [ 0.639107,  0.639107,  0.      ],
                          [ 0.      ,  0.      ,  0.      ],
                          [ 0.5     ,  0.      ,  0.5     ],
                          [-0.      ,  0.5     ,  0.5     ],
                          [ 0.186226,  0.186226,  0.      ],
                          [ 0.813774,  0.813774,  0.      ]]

# Set up configuration
bulk_configuration = BulkConfiguration(
    bravais_lattice=lattice,
    elements=elements,
    fractional_coordinates=fractional_coordinates
    )

# -------------------------------------------------------------
# Calculator
# -------------------------------------------------------------
#----------------------------------------
# Basis Set
#----------------------------------------
basis_set = [
    BasisGGAPseudoDojo.Oxygen_High,
    BasisGGAPseudoDojo.Copper_High,
    BasisGGAPseudoDojo.Lanthanum_High,
    ]

k_point_sampling = KpointDensity(
    density_a=7.0*Angstrom,
    )
numerical_accuracy_parameters = NumericalAccuracyParameters(
    density_mesh_cutoff=150.0*Hartree,
    k_point_sampling=k_point_sampling,
    )

iteration_control_parameters = IterationControlParameters(
    tolerance=0.000001,
    )

calculator = LCAOCalculator(
    basis_set=basis_set,
    numerical_accuracy_parameters=numerical_accuracy_parameters,
    iteration_control_parameters=iteration_control_parameters,
    )

bulk_configuration.setCalculator(calculator)
nlprint(bulk_configuration)
bulk_configuration.update()
nlsave('La2CuO4_ReducedTetragonal_I4mm Calc2.hdf5', bulk_configuration)

# -------------------------------------------------------------
# Bandstructure
# -------------------------------------------------------------
bandstructure = Bandstructure(
    configuration=bulk_configuration,
    route=['G', 'X', 'M', 'G', 'N', 'P', 'H', 'G'],
    points_per_segment=20,
    bands_above_fermi_level=All,
    method=Full,
    )
nlsave('La2CuO4_ReducedTetragonal_I4mm Calc2.hdf5', bandstructure)

# -------------------------------------------------------------
# Density Of States
# -------------------------------------------------------------
kpoint_grid = MonkhorstPackGrid(
    na=13,
    nb=13,
    nc=17,
    )

density_of_states = DensityOfStates(
    configuration=bulk_configuration,
    kpoints=kpoint_grid,
    energy_zero_parameter=FermiLevel,
    bands_above_fermi_level=All,
    method=Full,
    )

nlsave('La2CuO4_ReducedTetragonal_I4mm Calc2.hdf5', density_of_states)
nlprint(density_of_states)
Part 2 - Dynamical Matrix calculation using the converged calculation from Part 1 (unsuccessful, doesn't run, code stops):
Code
# -*- coding: utf-8 -*-
# -------------------------------------------------------------
# Analysis from File
# -------------------------------------------------------------
path = 'E:/Praful/La2CuO4/20240627/La2CuO4_ReducedTetragonal_I4mm Calc2.hdf5'
configuration = nlread(path, object_id='BulkConfiguration_1')[0]

# -------------------------------------------------------------
# Dynamical Matrix
# -------------------------------------------------------------
dynamical_matrix = DynamicalMatrix(
    configuration,
    filename='La2CuO4_ReducedTetragonal_I4mm Calc2.hdf5',
    object_id='dynamical_matrix',
    repetitions=Automatic,
    atomic_displacement=0.01*Angstrom,
    acoustic_sum_rule=True,
    finite_difference_method=Central,
    force_tolerance=1e-08*Hartree/Bohr**2,
    processes_per_displacement=None,
    log_filename_prefix='forces_displacement_',
    use_wigner_seitz_scheme=False,
    )
dynamical_matrix.update()

# -------------------------------------------------------------
# Phonon Bandstructure
# -------------------------------------------------------------
phonon_bandstructure = PhononBandstructure(
    configuration=configuration,
    dynamical_matrix=dynamical_matrix,
    route=['G', 'X', 'M', 'G', 'N', 'P', 'H', 'G'],
    points_per_segment=20,
    number_of_bands=All
    )
nlsave('La2CuO4_ReducedTetragonal_I4mm Calc2.hdf5', phonon_bandstructure)

# -------------------------------------------------------------
# Phonon Density Of States
# -------------------------------------------------------------
qpoint_grid = MonkhorstPackGrid(
    na=13,
    nb=13,
    nc=17,
    )

phonon_density_of_states = PhononDensityOfStates(
    configuration=configuration,
    dynamical_matrix=dynamical_matrix,
    qpoints=qpoint_grid,
    number_of_bands=None,
    )
nlsave('La2CuO4_ReducedTetragonal_I4mm Calc2.hdf5', phonon_density_of_states)
nlprint(phonon_density_of_states)

# -------------------------------------------------------------
# Vibrational Mode
# -------------------------------------------------------------
vibrational_mode = VibrationalMode(
    configuration=configuration,
    dynamical_matrix=dynamical_matrix,
    kpoint_fractional=[0, 0, 0],
    mode_indices=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],
    )
nlsave('La2CuO4_ReducedTetragonal_I4mm Calc2.hdf5', vibrational_mode)

# -------------------------------------------------------------
# Susceptibility Derivatives
# -------------------------------------------------------------
susceptibility_derivatives = SusceptibilityDerivatives(
    configuration,
    filename='La2CuO4_ReducedTetragonal_I4mm Calc2.hdf5',
    object_id='susceptibility_derivatives',
    atomic_displacement=0.01*Angstrom,
    finite_difference_method=Central,
    broadening=0.1*eV,
    bands_below_fermi_level=15,
    bands_above_fermi_level=15,
    processes_per_displacement=1,
    log_filename_prefix='susceptibility_displacement_',
)
susceptibility_derivatives.update()
Here is the log file of part 2:
Code
+------------------------------------------------------------------------------+
|                                                                              |
| QuantumATK R-2020.09[Build 0e538b3896]                                       |
|                                                                              |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
| Automatically detected repetitions = [7 7 3]                                 |
+------------------------------------------------------------------------------+

                            |--------------------------------------------------|
Calculating Kinetic Matrix : ==================================================

                            |--------------------------------------------------|
Calculating Nonlocal Part  : ==================================================
+------------------------------------------------------------------------------+
| Dynamical Matrix Study                                                       |
+------------------------------------------------------------------------------+
| 25 task(s) will be executed.                                                 |
|                                                                              |
| * Force calculation                                                          |
|   Atom index: 8                                                              |
|   Displacement direction: -z                                                 |
| * Force calculation                                                          |
|   Atom index: 8                                                              |
|   Displacement direction: +z                                                 |
| * Force calculation                                                          |
|   Atom index: 8                                                              |
|   Displacement direction: -y                                                 |
| * Force calculation                                                          |
|   Atom index: 8                                                              |
|   Displacement direction: +y                                                 |
| * Force calculation                                                          |
|   Atom index: 8                                                              |
|   Displacement direction: -x                                                 |
| * Force calculation                                                          |
|   Atom index: 8                                                              |
|   Displacement direction: +x                                                 |
| * Force calculation                                                          |
|   Atom index: 6                                                              |
|   Displacement direction: -z                                                 |
| * Force calculation                                                          |
|   Atom index: 6                                                              |
|   Displacement direction: +z                                                 |
| * Force calculation                                                          |
|   Atom index: 6                                                              |
|   Displacement direction: -y                                                 |
| * Force calculation                                                          |
|   Atom index: 6                                                              |
|   Displacement direction: +y                                                 |
| * Force calculation                                                          |
|   Atom index: 6                                                              |
|   Displacement direction: -x                                                 |
| * Force calculation                                                          |
|   Atom index: 6                                                              |
|   Displacement direction: +x                                                 |
| * Force calculation                                                          |
|   Atom index: 4                                                              |
|   Displacement direction: -z                                                 |
| * Force calculation                                                          |
|   Atom index: 4                                                              |
|   Displacement direction: +z                                                 |
| * Force calculation                                                          |
|   Atom index: 4                                                              |
|   Displacement direction: -y                                                 |
| * Force calculation                                                          |
|   Atom index: 4                                                              |
|   Displacement direction: +y                                                 |
| * Force calculation                                                          |
|   Atom index: 4                                                              |
|   Displacement direction: -x                                                 |
| * Force calculation                                                          |
|   Atom index: 4                                                              |
|   Displacement direction: +x                                                 |
| * Force calculation                                                          |
|   Atom index: 0                                                              |
|   Displacement direction: -z                                                 |
| * Force calculation                                                          |
|   Atom index: 0                                                              |
|   Displacement direction: +z                                                 |
| * Force calculation                                                          |
|   Atom index: 0                                                              |
|   Displacement direction: -y                                                 |
| * Force calculation                                                          |
|   Atom index: 0                                                              |
|   Displacement direction: +y                                                 |
| * Force calculation                                                          |
|   Atom index: 0                                                              |
|   Displacement direction: -x                                                 |
| * Force calculation                                                          |
|   Atom index: 0                                                              |
|   Displacement direction: +x                                                 |
| * Generate dynamical matrix from displaced forces                            |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
| Executing task 1 / 25:                                                       |
|   Force calculation                                                          |
|   Atom index: 8                                                              |
|   Displacement direction: -z                                                 |
|   Log to: forces_displacement_8_minus_z.log                                  |
+------------------------------------------------------------------------------+
After this the Job Manager says "finished"! But clearly, it is not. Please have a look if there are any issues with my settings or if anything is problematic. Any help/comment would be much appreciated. Kind regards, Praful

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5531
  • Country: dk
  • Reputation: 90
    • View Profile
    • QuantumATK at Synopsys
Re: Dynamical matrix calculation stuck/doesn't run
« Reply #1 on: August 27, 2024, 01:48 »
Pretty sure the calculation crashes because you don't have enough memory on the machine.