SCPH error

Hi all,

I am getting the below error when running SCPH. Can anyone help me to figure out the problem?

Iteration 0
Traceback (most recent call last):
File “7_scph.py”, line 36, in
parameters_traj = self_consistent_harmonic_model(
File “/home/ashis/miniconda3/envs/1my_env/lib/python3.8/site-packages/hiphive/self_consistent_phonons/self_consistent_harmonic_model.py”, line 89, in self_consistent_harmonic_model
sc.add_structure(structure)
File “/home/ashis/miniconda3/envs/1my_env/lib/python3.8/site-packages/hiphive/structure_container.py”, line 178, in add_structure
raise ValueError(‘Atoms is identical to structure {}’.format(i))
ValueError: Atoms is identical to structure 0

Below is the input file I used:

import os
import numpy as np
from ase.io import read
from hiphive import ClusterSpace, ForceConstantPotential
from hiphive.self_consistent_phonons import self_consistent_harmonic_model
from hiphive.calculators import ForceConstantCalculator

cutoffs = [5.5]
temperatures = [0, 300, 800, 1200]
size = 5

n_structures = 50
n_iterations = 200
alpha = 0.2

fcp = ForceConstantPotential.read(‘fcps/system-test.fcp’)
prim = read(‘POSCAR’)

setup scph

cs = ClusterSpace(prim, cutoffs)
supercell = prim.repeat(size)
fcs = fcp.get_force_constants(supercell)
calc = ForceConstantCalculator(fcs)

run scph

os.makedirs(‘scph_trajs/’, exist_ok=True)
for T in temperatures:
parameters_traj = self_consistent_harmonic_model(
supercell, calc, cs, T, alpha, n_iterations, n_structures)
fcp_scph = ForceConstantPotential(cs, parameters_traj[-1])
fcp_scph.write(‘fcps/scph_T{}.fcp’.format(T))
np.savetxt(‘scph_trajs/scph_parameters_T{}’.format(T), np.array(parameters_traj))

Thank you
Ashis

I’m guessing this is due to using T=0, meaning displacements are zero (since you’re using classical sampling).
Does it work for other temperatures?

Yes, it is working well with other temperatures. Thanks