scatsystem.h new prototype drafts and misc.

Former-commit-id: 954f4f82f5fc3932425b696b05dcab88a5566479
This commit is contained in:
Marek Nečada 2019-03-07 07:10:43 +00:00
parent 0fb36f1e4c
commit a4b0022305
4 changed files with 46 additions and 0 deletions

2
.gitignore vendored
View File

@ -3,4 +3,6 @@
*.swp
*.out
*.pdf
*.o
docs/*
qpms/qpms_c.c

View File

@ -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);

7
tests/interptest.py Normal file
View File

@ -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)

13
tests/scatsys.py Normal file
View File

@ -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)