Author Topic: Phonon spectrum error  (Read 6229 times)

0 Members and 1 Guest are viewing this topic.

Offline Dongzhe

  • Regular QuantumATK user
  • **
  • Posts: 21
  • Country: fr
  • Reputation: 1
    • View Profile
Phonon spectrum error
« on: December 28, 2023, 11:08 »
Dear ATK experts,

I have been using QuantumATK-T-2022.03 for the calculation of the Phonon band structure. I used 10 nodes.

The calculation of the dynamical matrix was done properly, then I got the following error:

-------------------------------------------------------------------------------------------------------------------------------------------

+------------------------------------------------------------------------------+
| Executing task 24 / 25:                                                      |
|   Force calculation                                                          |
|   Atom index: 0                                                              |
|   Displacement direction: +x                                                 |
|   Log to: forces_displacement_0_plus_x.log                                   |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
| Executing task 25 / 25:                                                      |
|   Generate dynamical matrix from displaced forces                            |
|   Log to: stdout                                                             |
+------------------------------------------------------------------------------+
Master    : Handling exception in delegator process.
  Traceback (most recent call last):
    File "zipdir/NL/ComputerScienceUtilities/ParallelTools/DynamicTaskScheduler.py", line 427, in __runInParallelModeAsDelegator
    File "zipdir/NL/ComputerScienceUtilities/Workflow/Workflow.py", line 1323, in schedulerCode
    File "zipdir/NL/ComputerScienceUtilities/ParallelTools/DynamicTaskScheduler.py", line 704, in waitAllTasksFinished
    File "zipdir/NL/ComputerScienceUtilities/ParallelTools/DynamicTaskScheduler.py", line 1075, in __processTask
  NL.ComputerScienceUtilities.ParallelTools.DynamicTaskScheduler.TaskExecutionError: An exception was raised while executing task "e64ae6a4a4e511ee92db080038b56985".
    Traceback (most recent call last):
      File "zipdir/NL/ComputerScienceUtilities/ParallelTools/DynamicTaskScheduler.py", line 1309, in __startParallelExecutionOnWorkerProcesses
      File "zipdir/NL/ComputerScienceUtilities/Workflow/Workflow.py", line 1081, in _runTask
      File "zipdir/NL/ComputerScienceUtilities/Workflow/Workflow.py", line 619, in run
      File "zipdir/NL/Study/DynamicalMatrixTasks.py", line 940, in _execute
      File "zipdir/NL/Study/DynamicalMatrixTasks.py", line 1031, in _applySymmetries
      File "zipdir/NL/Study/DynamicalMatrixTasks.py", line 1072, in getBlock
      File "zipdir/NLEngine.py", line 21582, in get
    RuntimeError:
    ** Back Engine Exception : Column index out of bounds
    ** Location of Exception : sparsematrix.h:140
-------------------------------------------------------------------------------------------------------------------------------------------

Do you have any thoughts on what might be causing the error?
Thanks,
Best regards,
Dongzhe Li (CNRS, France)

Offline Dongzhe

  • Regular QuantumATK user
  • **
  • Posts: 21
  • Country: fr
  • Reputation: 1
    • View Profile
Re: Phonon spectrum error
« Reply #1 on: January 3, 2024, 07:58 »
Dear again,

My input file is attached:


# -*- coding: utf-8 -*-
# -------------------------------------------------------------
# Bulk Configuration
# -------------------------------------------------------------

# Set up lattice
lattice = Hexagonal(4.000000017612248*Angstrom, 30.000000132091856*Angstrom)

# Define elements
elements = [Tellurium, Iron, Germanium, Iron, Iron, Tellurium]

# Define coordinates
fractional_coordinates = [[ 0.333333331756, -0.333333331756,  0.086864976284],
                          [ 0.            ,  0.            ,  0.041338246485],
                          [-0.333333331756,  0.333333331756,  0.            ],
                          [ 0.333333331756, -0.333333331756,  0.            ],
                          [ 0.            ,  0.            , -0.041338246485],
                          [ 0.333333331756, -0.333333331756, -0.086864976284]]

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

# -------------------------------------------------------------
# Calculator
# -------------------------------------------------------------
#----------------------------------------
# Exchange-Correlation
#----------------------------------------
exchange_correlation = SGGA.PBE

k_point_sampling = MonkhorstPackGrid(
    na=12,
    nb=12,
    )
numerical_accuracy_parameters = NumericalAccuracyParameters(
    density_mesh_cutoff=150.0*Hartree,
    k_point_sampling=k_point_sampling,
    occupation_method=FermiDirac(300.0*Kelvin*boltzmann_constant),
    )

iteration_control_parameters = IterationControlParameters(
    tolerance=1e-05,
    max_steps=300,
    )

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

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

# -------------------------------------------------------------
# Optimize Geometry
# -------------------------------------------------------------
bulk_configuration = OptimizeGeometry(
    bulk_configuration,
    max_forces=0.01*eV/Ang,
    max_steps=300,
    max_step_length=0.2*Ang,
    trajectory_filename='analysis_trajectory.hdf5',
    trajectory_interval=5.0*Minute,
    restart_strategy=RestartFromTrajectory(),
    disable_stress=True,
    optimizer_method=LBFGS(),
    enable_optimization_stop_file=True,
)
nlsave('analysis.hdf5', bulk_configuration)
nlprint(bulk_configuration)

# -------------------------------------------------------------
# Dynamical Matrix
# -------------------------------------------------------------
dynamical_matrix = DynamicalMatrix(
    bulk_configuration,
    filename='analysis.hdf5',
    object_id='dynamical_matrix',
    repetitions=(7, 7, 1),
    atomic_displacement=0.01*Angstrom,
    acoustic_sum_rule=True,
    finite_difference_method=Central,
    force_tolerance=1e-09*Hartree/Bohr**2,
    processes_per_displacement=None,
    log_filename_prefix='forces_displacement_',
    use_wigner_seitz_scheme=True,
    )
dynamical_matrix.update()

# -------------------------------------------------------------
# Phonon Bandstructure
# -------------------------------------------------------------
phonon_bandstructure = PhononBandstructure(
    configuration=bulk_configuration,
    dynamical_matrix=dynamical_matrix,
    route=['G', 'K', 'M', 'G'],
    points_per_segment=400,
    number_of_bands=All
    )
nlsave('analysis.hdf5', phonon_bandstructure)

The calculation for the dynamical matrix has been finished properly, but I got an error in plotting bands.

Best regards,
Dongzhe (CNRS, France)


Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Phonon spectrum error
« Reply #2 on: January 12, 2024, 21:11 »
What error? In the GUI?

Offline Dongzhe

  • Regular QuantumATK user
  • **
  • Posts: 21
  • Country: fr
  • Reputation: 1
    • View Profile
Re: Phonon spectrum error
« Reply #3 on: January 16, 2024, 06:55 »
Dear,

This is the error message (just before the phonon band structure, after the calculation of the dynamical matrix):

-------------------------------------------------------------------------------------------------------------
Master    : Handling exception in delegator process.
  Traceback (most recent call last):
    File "zipdir/NL/ComputerScienceUtilities/ParallelTools/DynamicTaskScheduler.py", line 427, in __runInParallelModeAsDelegator
    File "zipdir/NL/ComputerScienceUtilities/Workflow/Workflow.py", line 1323, in schedulerCode
    File "zipdir/NL/ComputerScienceUtilities/ParallelTools/DynamicTaskScheduler.py", line 704, in waitAllTasksFinished
    File "zipdir/NL/ComputerScienceUtilities/ParallelTools/DynamicTaskScheduler.py", line 1075, in __processTask
  NL.ComputerScienceUtilities.ParallelTools.DynamicTaskScheduler.TaskExecutionError: An exception was raised while executing task "e64ae6a4a4e511ee92db080038b56985".
    Traceback (most recent call last):
      File "zipdir/NL/ComputerScienceUtilities/ParallelTools/DynamicTaskScheduler.py", line 1309, in __startParallelExecutionOnWorkerProcesses
      File "zipdir/NL/ComputerScienceUtilities/Workflow/Workflow.py", line 1081, in _runTask
      File "zipdir/NL/ComputerScienceUtilities/Workflow/Workflow.py", line 619, in run
      File "zipdir/NL/Study/DynamicalMatrixTasks.py", line 940, in _execute
      File "zipdir/NL/Study/DynamicalMatrixTasks.py", line 1031, in _applySymmetries
      File "zipdir/NL/Study/DynamicalMatrixTasks.py", line 1072, in getBlock
      File "zipdir/NLEngine.py", line 21582, in get
    RuntimeError:
    ** Back Engine Exception : Column index out of bounds
    ** Location of Exception : sparsematrix.h:140
-------------------------------------------------------------------------------------------------------------------------------------------

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Phonon spectrum error
« Reply #4 on: January 19, 2024, 01:36 »
Given that this is a rather large calculation, do you mind sharing the HDF5 file, it might save time. Assuming, that is, that the DynamicalMatrix object was actually saved in the file, which it might not be if the error occurred while saving it.

Also, which version used?

Offline Dongzhe

  • Regular QuantumATK user
  • **
  • Posts: 21
  • Country: fr
  • Reputation: 1
    • View Profile
Re: Phonon spectrum error
« Reply #5 on: January 22, 2024, 11:08 »
Dear Anders,
Thanks for your reply.
I used "QuantumATK-T-2022.03".
You can download the hdf5 and input/output files of my calculation using the following link:
https://filesender.renater.fr/?s=download&token=9fdc8987-6eb5-4c5d-b846-fb4934f78f64
BTW, I used sufficiently large RAM.
Best regards,
Dongzhe (CNRS, France)

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Phonon spectrum error
« Reply #6 on: January 22, 2024, 21:58 »
Looking at the structure, I would recommend centering the atoms in the Z direction, so that the 2D sheet is in the middle of the cell, instead of straddling the periodic boundary, since the structure is actually not supposed to be periodic in the Z direction (although it always will be in practice, but with a large vacuum gap). Perhaps the algorithm doesn't know what to do when there are bonds and symmetries extended across a direction in which you have 1 repetitions for the dynamical matrix, as you correctly should have for this calculation.

So, in the Builder, just shift all atoms by say fractional 0.3 in the z direction, then wrap and center, and try that geometry instead.

Also, remember to check if the structure is optimized first. It seems somewhat unlikely that the lattice constant will be EXACTLY 4 Angstrom...

Offline Dongzhe

  • Regular QuantumATK user
  • **
  • Posts: 21
  • Country: fr
  • Reputation: 1
    • View Profile
Re: Phonon spectrum error
« Reply #7 on: January 25, 2024, 08:56 »
Dear Anders,

I tested with another geometry with fractional 0.3 in the z direction, I ended up with the same error. The dynamical matrix part is finished without problems, but it gets an error for the Phonon band.

Previously, I also tested the silicon tutorial with no problems.

+------------------------------------------------------------------------------+
| Executing task 25 / 25:                                                      |
|   Generate dynamical matrix from displaced forces                            |
|   Log to: stdout                                                             |
+------------------------------------------------------------------------------+
Master    : Handling exception in delegator process.
  Traceback (most recent call last):
    File "zipdir/NL/ComputerScienceUtilities/ParallelTools/DynamicTaskScheduler.py", line 427, in __runInParallelModeAsDelegator
    File "zipdir/NL/ComputerScienceUtilities/Workflow/Workflow.py", line 1323, in schedulerCode
    File "zipdir/NL/ComputerScienceUtilities/ParallelTools/DynamicTaskScheduler.py", line 704, in waitAllTasksFinished
    File "zipdir/NL/ComputerScienceUtilities/ParallelTools/DynamicTaskScheduler.py", line 1075, in __processTask
  NL.ComputerScienceUtilities.ParallelTools.DynamicTaskScheduler.TaskExecutionError: An exception was raised while executing task "20a64c4cba8711ee95c4080038b56a4d".
    Traceback (most recent call last):
      File "zipdir/NL/ComputerScienceUtilities/ParallelTools/DynamicTaskScheduler.py", line 1309, in __startParallelExecutionOnWorkerProcesses
      File "zipdir/NL/ComputerScienceUtilities/Workflow/Workflow.py", line 1081, in _runTask
      File "zipdir/NL/ComputerScienceUtilities/Workflow/Workflow.py", line 619, in run
      File "zipdir/NL/Study/DynamicalMatrixTasks.py", line 940, in _execute
      File "zipdir/NL/Study/DynamicalMatrixTasks.py", line 1031, in _applySymmetries
      File "zipdir/NL/Study/DynamicalMatrixTasks.py", line 1072, in getBlock
      File "zipdir/NLEngine.py", line 21582, in get
    RuntimeError:
    ** Back Engine Exception : Column index out of bounds
    ** Location of Exception : sparsematrix.h:140

Is it a bug for magnetic systems?

Best regards,
Dongzhe (CNRS, France)

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Phonon spectrum error
« Reply #8 on: January 29, 2024, 19:37 »
We are investigating

Offline Julian Schneider

  • QuantumATK Staff
  • QuantumATK Guru
  • *****
  • Posts: 164
  • Country: dk
  • Reputation: 25
    • View Profile
Re: Phonon spectrum error
« Reply #9 on: February 5, 2024, 10:24 »
We could run the calculation on our side without error, so it does not seem like a bug. It looks like in your case it goes wrong when using the symmetries. We are still investigating what it could be. In the meantime, I would recommend to run the calculation with setting
Code
use_symmetry=False
in the DynamicalMatrix. You can actually try to run it on the same file, ideally it should only do the missing displacement calculations of the equivalent atoms, but re-.use the already calculated atom displacements.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Phonon spectrum error
« Reply #10 on: February 5, 2024, 19:52 »
Just now noticed that the error appears in an older version (2022.03). We strongly suggest running with the new 2023.12, containing many new features and at least in this case also possibly a fix for this problem (by accident or some bug we solved).

Offline Dongzhe

  • Regular QuantumATK user
  • **
  • Posts: 21
  • Country: fr
  • Reputation: 1
    • View Profile
Re: Phonon spectrum error
« Reply #11 on: February 13, 2024, 09:43 »
Thanks for your kind help, it is indeed working with the newest version.
Best regards,
Dongzhe (CNRS, France)