Dear hiPhive developer,
I am a new user of hiPhive and would like to apply the rotational sum rule on the 2nd order force constant of two-dimensional material. After getting the force_constants.hdf5 file by phonopy I used the following script to generate a further corrected force file.
from ase.io import read
from hiphive import ClusterSpace, ForceConstantPotential, enforce_rotational_sum_rules
from hiphive.cutoffs import estimate_maximum_cutoff
from hiphive.utilities import extract_parameters
from hiphive import ForceConstants, ClusterSpace, ForceConstantPotential
from hiphive import enforce_rotational_sum_rules
from hiphive.utilities import extract_parameters
prim = read(âPOSCARâ)
supercell = read(âSPOSCARâ)
max_cutoff = estimate_maximum_cutoff(supercell) - 0.01
cutoffs = [max_cutoff] # only second order needed
cs = ClusterSpace(prim, cutoffs)
phonopy
fcs = ForceConstants.read_phonopy(supercell,âforce_constants.hdf5â)
parameters = extract_parameters(fcs, cs)
parameters_rot = enforce_rotational_sum_rules(cs, parameters, [âHuangâ, âBorn-Huangâ])
fcp = ForceConstantPotential(cs, parameters_rot)
fcs = fcp.get_force_constants(supercell)
fcs.write_to_phonopy(âfc2_rotinv.hdf5â, format=âhdf5â)
But error occurred
Traceback (most recent call last):
** File âFconversionâ, line 18, in **
** fcs = ForceConstants.read_phonopy(supercell,âforce_constants.hdf5â)**
** File â/iitjhome/kukreti1/.local/lib/python3.8/site-packages/hiphive-1.1-py3.8.egg/hiphive/force_constants.pyâ, line 348, in read_phonopy**
** File â/iitjhome/kukreti1/.local/lib/python3.8/site-packages/hiphive-1.1-py3.8.egg/hiphive/force_constants.pyâ, line 288, in from_arrays**
ValueError: fc2 array has wrong shape
I am unable to solve this issue. Kindly tell me the way so that I can get corrected force constants.
Thank You
Regards
Sumit Kukreti
Ph.D. Scholar
IIT Jodhpur INDIA