1 #ifndef CASM_SymRepBuilder
2 #define CASM_SymRepBuilder
10 #include "casm/misc/KroneckerTensorProduct.h"
44 Eigen::Ref<const Eigen::Matrix3d>
const &_matrix,
45 Eigen::Ref<const Eigen::Vector3d>
const &_tau,
bool time_reversal,
54 Eigen::Ref<const Eigen::Matrix3d>
const &_matrix,
55 Eigen::Ref<const Eigen::Vector3d>
const &_tau,
bool time_reversal,
58 .cast<std::complex<double> >();
61 std::unique_ptr<SymRepBuilderInterface>
clone()
const {
62 return std::unique_ptr<SymRepBuilderInterface>(
_clone());
72 template <
bool _uses_time_reversal>
92 Eigen::Ref<const Eigen::Matrix3d>
const &_matrix,
93 Eigen::Ref<const Eigen::Vector3d>
const &_tau,
bool time_reversal,
94 Index dim)
const override {
109 Eigen::Ref<const Eigen::Matrix3d>
const &_matrix,
110 Eigen::Ref<const Eigen::Vector3d>
const &_tau,
bool time_reversal,
111 Index dim)
const override {
123 template <
typename Builder1,
typename Builder2, Index Dim1, Index Dim2>
126 Builder2::uses_time_reversal> {
129 Builder1::uses_time_reversal || Builder2::uses_time_reversal;
131 Builder1 _builder1 = Builder1(),
132 Builder2 _builder2 = Builder2())
138 Eigen::Ref<const Eigen::Matrix3d>
const &_matrix,
139 Eigen::Ref<const Eigen::Vector3d>
const &_tau,
bool time_reversal,
140 Index dim)
const override {
141 assert(dim == Dim1 * Dim2);
144 m_builder1.symop_to_matrix(_matrix, _tau, time_reversal, Dim1),
145 m_builder2.symop_to_matrix(_matrix, _tau, time_reversal, Dim2), result);
165 Eigen::Ref<const Eigen::Matrix3d>
const &_matrix,
166 Eigen::Ref<const Eigen::Vector3d>
const &_tau,
bool time_reversal,
167 Index dim)
const override {
185 Eigen::Ref<const Eigen::Matrix3d>
const &_matrix,
186 Eigen::Ref<const Eigen::Vector3d>
const &_tau,
bool time_reversal,
187 Index dim)
const override {
188 return ((time_reversal ? -1. : 1.) * _matrix.determinant()) * _matrix;
204 Eigen::Ref<const Eigen::Matrix3d>
const &_matrix,
205 Eigen::Ref<const Eigen::Vector3d>
const &_tau,
bool time_reversal,
206 Index dim)
const override {
223 Eigen::Ref<const Eigen::Vector3d>
const &_tau,
225 Index dim)
const override {
228 result << S(0, 0) * S(0, 0), S(0, 1) * S(0, 1), S(0, 2) * S(0, 2),
229 sqrt(2) * S(0, 1) * S(0, 2), sqrt(2) * S(0, 2) * S(0, 0),
230 sqrt(2) * S(0, 0) * S(0, 1), S(1, 0) * S(1, 0), S(1, 1) * S(1, 1),
231 S(1, 2) * S(1, 2), sqrt(2) * S(1, 1) * S(1, 2),
232 sqrt(2) * S(1, 2) * S(1, 0), sqrt(2) * S(1, 0) * S(1, 1),
233 S(2, 0) * S(2, 0), S(2, 1) * S(2, 1), S(2, 2) * S(2, 2),
234 sqrt(2) * S(2, 1) * S(2, 2), sqrt(2) * S(2, 2) * S(2, 0),
235 sqrt(2) * S(2, 0) * S(2, 1), sqrt(2) * S(1, 0) * S(2, 0),
236 sqrt(2) * S(1, 1) * S(2, 1), sqrt(2) * S(1, 2) * S(2, 2),
237 S(1, 1) * S(2, 2) + S(1, 2) * S(2, 1),
238 S(1, 0) * S(2, 2) + S(1, 2) * S(2, 0),
239 S(1, 1) * S(2, 0) + S(1, 0) * S(2, 1), sqrt(2) * S(2, 0) * S(0, 0),
240 sqrt(2) * S(2, 1) * S(0, 1), sqrt(2) * S(2, 2) * S(0, 2),
241 S(2, 1) * S(0, 2) + S(2, 2) * S(0, 1),
242 S(2, 0) * S(0, 2) + S(2, 2) * S(0, 0),
243 S(2, 1) * S(0, 0) + S(2, 0) * S(0, 1), sqrt(2) * S(0, 0) * S(1, 0),
244 sqrt(2) * S(0, 1) * S(1, 1), sqrt(2) * S(0, 2) * S(1, 2),
245 S(0, 1) * S(1, 2) + S(0, 2) * S(1, 1),
246 S(0, 0) * S(1, 2) + S(0, 2) * S(1, 0),
247 S(0, 1) * S(1, 0) + S(0, 0) * S(1, 1);
265 Eigen::Ref<const Eigen::Matrix3d>
const &_matrix,
266 Eigen::Ref<const Eigen::Vector3d>
const &_tau,
bool time_reversal,
267 Index dim)
const override {
271 result << 0, 1, 1, 0;
273 result << 1, 0, 0, 1;
291 Eigen::Ref<const Eigen::Matrix3d>
const &_matrix,
292 Eigen::Ref<const Eigen::Vector3d>
const &_tau,
bool time_reversal,
293 Index dim)
const override {
297 P << 0, 1 / sqrt(2), 0, 1 / sqrt(2), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
298 1 / sqrt(2), 0, 1 / sqrt(2), 0, -1 / sqrt(6), 0, 0, 0, -1 / sqrt(6), 0,
299 0, 0, 2 / sqrt(6), 0, 0, 1 / sqrt(2), 0, 0, 0, 1 / sqrt(2), 0, 0,
300 1 / sqrt(2), 0, 0, 0, -1 / sqrt(2), 0, 0, 0, 0;
304 Q << 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
305 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
306 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
307 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
308 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
309 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
310 1 / sqrt(2), 0, 0, 0, 1 / sqrt(2), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
311 0, 0, 0, 1 / sqrt(2), 0, 0, 0, 0, 0, 0, 0, 1 / sqrt(2), 0, 0, 0, 0, 0,
312 0, 0, 0, 0, 0, 0, 1 / sqrt(2), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
313 1 / sqrt(2), 0, 0, 0, 0, 0, 0, 0, 1 / sqrt(2), 0, 0, 0, 0, 0, 0, 0, 0,
314 0, 0, 0, 0, 0, 0, 0, 1 / sqrt(2), 0, 0, 0, 0, 0, 0, 0, 1 / sqrt(2), 0,
315 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 / sqrt(2), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
316 0, 1 / sqrt(2), 0, 0, 0, 0, 0, 0, 0, 1 / sqrt(2), 0, 0, 0, 0, 0, 0, 0,
317 0, 0, 0, 0, 0, 0, 0, 0, 1 / sqrt(2), 0, 0, 0, 1 / sqrt(2), 0, 0, 0, 0,
318 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
319 1 / sqrt(2), 0, 0, 0, 1 / sqrt(2), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
320 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 / sqrt(2), 0, 0, 0,
321 1 / sqrt(2), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 / sqrt(2),
322 0, 0, 0, 0, 0, 0, 0, 1 / sqrt(2), 0, 0, 0, 0, 0, 0, 0, 0;
325 Eigen::kroneckerProduct(_matrix, _matrix, kron_S_S);
328 Eigen::kroneckerProduct(G.transpose(), G.transpose(), kron_GT_GT);
343 dOrbitalOccupationSymRepBuilder, 2, 15> {
350 namespace SymRepBuilder {
Builds symmetry representation that is the angular momentum symmetry representation of provided symop...
SymRepBuilderInterface * _clone() const override
Eigen::MatrixXd symop_to_matrix(Eigen::Ref< const Eigen::Matrix3d > const &_matrix, Eigen::Ref< const Eigen::Vector3d > const &_tau, bool time_reversal, Index dim) const override
Given the 3x3 rotation/rotoreflection matrix, translation vector 'tau', and time_reversal operator of...
AngularMomentumSymRepBuilder()
Builds symmetry representation as the Cartesian matrix of povided SymOp.
SymRepBuilderInterface * _clone() const override
Eigen::MatrixXd symop_to_matrix(Eigen::Ref< const Eigen::Matrix3d > const &_matrix, Eigen::Ref< const Eigen::Vector3d > const &_tau, bool time_reversal, Index dim) const override
Given the 3x3 rotation/rotoreflection matrix, translation vector 'tau', and time_reversal operator of...
Builds symmetry representation as the 'dim' x 'dim' identity matrix, regardless of symop.
SymRepBuilderInterface * _clone() const override
Eigen::MatrixXd symop_to_matrix(Eigen::Ref< const Eigen::Matrix3d > const &_matrix, Eigen::Ref< const Eigen::Vector3d > const &_tau, bool time_reversal, Index dim) const override
Given the 3x3 rotation/rotoreflection matrix, translation vector 'tau', and time_reversal operator of...
Builds symmetry representation as the Kronecker product of two other representations.
SymRepBuilderInterface * _clone() const override
static const bool uses_time_reversal
KroneckerSymRepBuilder(std::string const &_name, Builder1 _builder1=Builder1(), Builder2 _builder2=Builder2())
Eigen::MatrixXd symop_to_matrix(Eigen::Ref< const Eigen::Matrix3d > const &_matrix, Eigen::Ref< const Eigen::Vector3d > const &_tau, bool time_reversal, Index dim) const override
Given the 3x3 rotation/rotoreflection matrix, translation vector 'tau', and time_reversal operator of...
Un-cloneable class for specifying absence of valid SymRepBuilder.
Eigen::MatrixXd symop_to_matrix(Eigen::Ref< const Eigen::Matrix3d > const &_matrix, Eigen::Ref< const Eigen::Vector3d > const &_tau, bool time_reversal, Index dim) const override
Given the 3x3 rotation/rotoreflection matrix, translation vector 'tau', and time_reversal operator of...
SymRepBuilderInterface * _clone() const override
Build 6x6 symmetry representation for a rank 2 Cartesian tensor represented in Kelvin notation.
Rank2TensorSymRepBuilder()
Eigen::MatrixXd symop_to_matrix(Eigen::Ref< const Eigen::Matrix3d > const &S, Eigen::Ref< const Eigen::Vector3d > const &_tau, bool time_reversal, Index dim) const override
Given the 3x3 rotation/rotoreflection matrix, translation vector 'tau', and time_reversal operator of...
SymRepBuilderInterface * _clone() const override
Abstract base class that provides interface for converting cartesian isometry to specialized transfor...
SymRepBuilderInterface(std::string const &_name, bool _time_reversal_active)
Interace class manages the name of the SymRepBuilder and whether it is affected by time-reversal (i....
virtual Eigen::MatrixXd symop_to_matrix(Eigen::Ref< const Eigen::Matrix3d > const &_matrix, Eigen::Ref< const Eigen::Vector3d > const &_tau, bool time_reversal, Index dim) const =0
Given the 3x3 rotation/rotoreflection matrix, translation vector 'tau', and time_reversal operator of...
std::unique_ptr< SymRepBuilderInterface > clone() const
bool m_time_reversal_active
virtual ~SymRepBuilderInterface()
Virtual destructor allows deletion of derived classes through pointer to interface.
virtual SymRepBuilderInterface * _clone() const =0
std::string const & name() const
Returns name of SymRepBuilder type.
bool time_reversal_active() const
Returns true if symmetry representation is affected by time-reversal.
virtual Eigen::MatrixXcd symop_to_complex_matrix(Eigen::Ref< const Eigen::Matrix3d > const &_matrix, Eigen::Ref< const Eigen::Vector3d > const &_tau, bool time_reversal, Index dim) const
Given the 3x3 rotation/rotoreflection matrix, translation vector 'tau', and time_reversal operator of...
TemplateSymRepBuilderBase(std::string const &_name)
static const bool uses_time_reversal
Eigen::MatrixXd symop_to_matrix(Eigen::Ref< const Eigen::Matrix3d > const &_matrix, Eigen::Ref< const Eigen::Vector3d > const &_tau, bool time_reversal, Index dim) const override
Given the 3x3 rotation/rotoreflection matrix, translation vector 'tau', and time_reversal operator of...
TimeReversalSwapSymRepBuilder()
SymRepBuilderInterface * _clone() const override
Builds symmetry representation that is 'dim'x'dim' +Identity (-Identity) matrix if time_reversal is f...
Eigen::MatrixXd symop_to_matrix(Eigen::Ref< const Eigen::Matrix3d > const &_matrix, Eigen::Ref< const Eigen::Vector3d > const &_tau, bool time_reversal, Index dim) const override
Given the 3x3 rotation/rotoreflection matrix, translation vector 'tau', and time_reversal operator of...
TimeReversalSymRepBuilder()
SymRepBuilderInterface * _clone() const override
dOrbitalOccupationSpinPolarizedSymRepBuilder()
SymRepBuilderInterface * _clone() const override
dOrbitalOccupationSymRepBuilder()
Eigen::MatrixXd symop_to_matrix(Eigen::Ref< const Eigen::Matrix3d > const &_matrix, Eigen::Ref< const Eigen::Vector3d > const &_tau, bool time_reversal, Index dim) const override
Given the 3x3 rotation/rotoreflection matrix, translation vector 'tau', and time_reversal operator of...
TimeReversalSymRepBuilder TimeReversal()
AngularMomentumSymRepBuilder AngularMomentum()
dOrbitalOccupationSymRepBuilder dOrbitalOccupation()
IdentitySymRepBuilder Identity()
dOrbitalOccupationSpinPolarizedSymRepBuilder dOrbitalOccupationSpinPolarized()
Rank2TensorSymRepBuilder Rank2Tensor()
CartesianSymRepBuilder Cartesian()
INDEX_TYPE Index
For long integer indexing: