diff --git a/.gitignore b/.gitignore index f4ad6b9..9526a5b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,6 @@ *.swp *.out *.pdf +*.o docs/* +qpms/qpms_c.c diff --git a/qpms/scatsystem.h b/qpms/scatsystem.h index 188e071..f1f2438 100644 --- a/qpms/scatsystem.h +++ b/qpms/scatsystem.h @@ -412,6 +412,30 @@ qpms_scatsys_t *qpms_scatsys_apply_symmetry(const qpms_scatsys_t *orig, const st /// Destroys the result of qpms_scatsys_apply_symmetry or qpms_scatsys_load. void qpms_scatsys_free(qpms_scatsys_t *s); +/// Projects a "big" matrix onto an irrep. +/** TODO doc */ +qpms_errno_t qpms_scatsys_irrep_pack_matrix(complex double *target_packed, + const complex double *orig_full, const qpms_scatsys_t *ss, + qpms_iri_t iri); + +/// Transforms a big "packed" matrix into the full basis. +/** TODO doc */ +qpms_errno_t qpms_scatsys_irrep_unpack_matrix(complex double *target_full, + const complex double *orig_packed, const qpms_scatsys_t *ss, + bool add); + +/// Projects a "big" vector onto an irrep. +/** TODO doc */ +qpms_errno_t qpms_scatsys_irrep_pack_vector(complex double *target_packed, + const complex double *orig_full, const qpms_scatsys_t *ss, + qpms_iri_t iri); + +/// Transforms a big "packed" vector into the full basis. +/** TODO doc */ +qpms_errno_t qpms_scatsys_irrep_unpack_vector(complex double *target_full, + const complex double *orig_packed, const qpms_scatsys_t *ss, + bool add); + /// NOT IMPLEMENTED Dumps a qpms_scatsys_t structure to a file. qpms_errno_t qpms_scatsys_dump(qpms_scatsys_t *ss, char *path); diff --git a/tests/interptest.py b/tests/interptest.py new file mode 100644 index 0000000..0458f07 --- /dev/null +++ b/tests/interptest.py @@ -0,0 +1,7 @@ + +from qpms import Particle, CTMatrix, BaseSpec, FinitePointGroup, ScatteringSystem, TMatrixInterpolator +bspec1 = BaseSpec(lMax = 1) + +tmfile = '/home/mmn/tmp/cylinder_50nm_lMax4_cleaned.TMatrix' +interp = TMatrixInterpolator(tmfile, bspec1) +interp(3) diff --git a/tests/scatsys.py b/tests/scatsys.py new file mode 100644 index 0000000..3367200 --- /dev/null +++ b/tests/scatsys.py @@ -0,0 +1,13 @@ +from qpms import Particle, CTMatrix, BaseSpec, FinitePointGroup, ScatteringSystem +from qpms.symmetries import point_group_info +import numpy as np + +sym = FinitePointGroup(point_group_info['D3h']) +bspec2 = BaseSpec(lMax=2) +bspec1 = BaseSpec(lMax=1) +t1 = CTMatrix(bspec1, np.diag(np.random.random(len(bspec1)))) +t2 = CTMatrix(bspec2, np.diag(np.random.random(len(bspec2)))) +p1 = Particle((1,2,),t1) +p2 = Particle((1,2,3),t1) +p3 = Particle((0.1,2),t2) +ss = ScatteringSystem([p1, p2, p3], sym)