Expose Ewald parameter to Python

Former-commit-id: dc3e794f0cb146da3ab8d8dd5e46c81997e8bc51
This commit is contained in:
Marek Nečada 2020-04-21 23:34:49 +03:00
parent 69fd19c019
commit 83e76b1f95
2 changed files with 18 additions and 0 deletions

View File

@ -567,6 +567,23 @@ cdef class ScatteringSystem:
else: else:
return None return None
property eta:
"""Ewald parameter η"""
def __get__(self):
self.check_s()
if self.lattice_dimension:
return self.s[0].per.eta
else:
return None
def __set__(self, eta):
self.check_s()
if self.lattice_dimension:
self.s[0].per.eta = eta
else:
raise AttributeError("Cannot set Ewald parameter for finite system") # different exception?
def pack_vector(self, vect, iri): def pack_vector(self, vect, iri):
"""Converts (projects) a full excitation coefficient vector into an irrep subspace. """Converts (projects) a full excitation coefficient vector into an irrep subspace.

View File

@ -603,6 +603,7 @@ cdef extern from "scatsystem.h":
struct qpms_scatsys_periodic_info_t: struct qpms_scatsys_periodic_info_t:
cart3_t lattice_basis[3] cart3_t lattice_basis[3]
double unitcell_volume double unitcell_volume
double eta
#etc. #etc.
struct qpms_scatsys_t: struct qpms_scatsys_t:
int lattice_dimension int lattice_dimension