2019-02-20 09:57:36 +02:00
|
|
|
|
/*! \file scatsystem.h
|
|
|
|
|
* \brief Modern interface for finite lattice calculations, including symmetries.
|
|
|
|
|
*/
|
|
|
|
|
#ifndef QPMS_SCATSYSTEM_H
|
|
|
|
|
#define QPMS_SCATSYSTEM_H
|
2019-02-21 05:48:35 +02:00
|
|
|
|
#include "vswf.h"
|
2019-02-20 09:57:36 +02:00
|
|
|
|
|
|
|
|
|
/// A T-matrix.
|
|
|
|
|
/** In the future, I might rather use a more abstract approach in which T-matrix
|
|
|
|
|
* is a mapping (function) of the field expansion coefficients.
|
|
|
|
|
* So the interface might change.
|
|
|
|
|
* For now, let me stick to the square dense matrix representation.
|
|
|
|
|
*/
|
|
|
|
|
typedef struct qpms_tmatrix_t {
|
2019-02-21 05:48:35 +02:00
|
|
|
|
/** \brief VSWF basis specification, NOT owned by qpms_tmatrix_t by default.
|
|
|
|
|
*
|
|
|
|
|
* Usually not checked for meaningfulness by the functions (methods),
|
|
|
|
|
* so the caller should take care that \a spec->ilist does not
|
|
|
|
|
* contain any duplicities and that for each wave with order \a m
|
|
|
|
|
* there is also one with order \a −m.
|
|
|
|
|
*/
|
|
|
|
|
const qpms_vswf_set_spec_t *spec;
|
|
|
|
|
complex double *m; ///< Matrix elements in row-major order.
|
2019-02-20 09:57:36 +02:00
|
|
|
|
} qpms_tmatrix_t;
|
2019-02-21 05:48:35 +02:00
|
|
|
|
|
2019-02-20 09:57:36 +02:00
|
|
|
|
/// Returns a pointer to the beginning of the T-matrix row \a rowno.
|
|
|
|
|
static inline complex double *qpms_tmatrix_row(qpms_tmatrix_t *t, size_t rowno){
|
|
|
|
|
return t->m + (t->spec->n * rowno);
|
|
|
|
|
}
|
2019-02-21 05:48:35 +02:00
|
|
|
|
|
|
|
|
|
/// Initialises a zero T-matrix.
|
2019-02-20 09:57:36 +02:00
|
|
|
|
qpms_tmatrix_t *qpms_tmatrix_init(const qpms_vswf_set_spec_t *bspec);
|
|
|
|
|
|
2019-02-21 05:48:35 +02:00
|
|
|
|
/// Destroys a T-matrix.
|
|
|
|
|
void qpms_tmatrix_free(qpms_tmatrix_t *t);
|
2019-02-20 09:57:36 +02:00
|
|
|
|
|
|
|
|
|
/// A particle, defined by its T-matrix and position.
|
|
|
|
|
typedef struct qpms_particle_t {
|
|
|
|
|
// Does it make sense to ever use other than cartesian coords for this?
|
|
|
|
|
cart3_t pos; ///< Particle position in cartesian coordinates.
|
|
|
|
|
const qpms_tmatrix_t *tmatrix; ///< T-matrix; not owned by qpms_particle_t.
|
|
|
|
|
} qpms_particle_t;
|
|
|
|
|
|
2019-02-21 05:48:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// Creates a T-matrix from another matrix and a symmetry operation.
|
|
|
|
|
/** The symmetry operation is expected to be a unitary (square)
|
|
|
|
|
* matrix \a M with the same
|
|
|
|
|
* VSWF basis spec as the T-matrix (i.e. \a t->spec). The new T-matrix will then
|
|
|
|
|
* correspond to CHECKME \f[ T' = MTM^\dagger \f]
|
|
|
|
|
*/
|
|
|
|
|
qpms_tmatrix_t *qpms_tmatrix_apply_symop(
|
|
|
|
|
const qpms_tmatrix_t *T, ///< the original T-matrix
|
|
|
|
|
const complex double *M ///< the symmetry op matrix in row-major format
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
/// Symmetrizes a T-matrix with an involution symmetry operation.
|
|
|
|
|
/** The symmetry operation is expected to be a unitary (square)
|
|
|
|
|
* matrix \a M with the same
|
|
|
|
|
* VSWF basis spec as the T-matrix (i.e. \a t->spec). The new T-matrix will then
|
|
|
|
|
* correspond to CHECKME \f[ T' = \frac{T + MTM^\dagger}{2} \f]
|
|
|
|
|
*/
|
|
|
|
|
qpms_tmatrix_t *qpms_tmatrix_symmetrise_involution(
|
|
|
|
|
const qpms_tmatrix_t *T, ///< the original T-matrix
|
|
|
|
|
const complex double *M ///< the symmetry op matrix in row-major format
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
/// Creates a \f$ C_\infty \f$ -symmetrized version of a T-matrix.
|
|
|
|
|
/**
|
|
|
|
|
* \f[ {T'}_{tlm}^{\tau\lambda\mu} = T_{tlm}^{\tau\lambda\mu} \delta_{m\mu} \f]
|
|
|
|
|
*/
|
|
|
|
|
qpms_tmatrix_t *qpms_tmatrix_symmetrise_C_inf(
|
|
|
|
|
const qpms_tmatrix_t *T ///< the original T-matrix
|
|
|
|
|
);
|
|
|
|
|
/// Creates a \f$ C_N \f$ -symmetrized version of a T-matrix.
|
|
|
|
|
/**
|
|
|
|
|
* \f[ {T'}_{tlm}^{\tau\lambda\mu} = \begin{cases}
|
|
|
|
|
* T{}_{lm}^{\lambda\mu} & (m-\mu)\mod N=0\\
|
|
|
|
|
* 0 & (m-\mu)\mod N\ne0
|
|
|
|
|
* \end{cases} . \f]
|
|
|
|
|
*/
|
|
|
|
|
qpms_tmatrix_t *qpms_tmatrix_symmetrise_C_N(
|
|
|
|
|
const qpms_tmatrix_t *T, ///< the original T-matrix
|
|
|
|
|
int N ///< number of z-axis rotations in the group
|
|
|
|
|
);
|
|
|
|
|
|
2019-02-20 09:57:36 +02:00
|
|
|
|
#endif //QPMS_SCATSYSTEM_H
|