一些小修改,应该不影响结果
This commit is contained in:
22
src/fold.cpp
22
src/fold.cpp
@@ -11,15 +11,17 @@ void ufo::fold(std::string config_file)
|
|||||||
|
|
||||||
auto fold = []
|
auto fold = []
|
||||||
(
|
(
|
||||||
|
Eigen::Matrix3d super_cell_deformation,
|
||||||
|
Eigen::Vector3i super_cell_multiplier,
|
||||||
Eigen::Vector3d qpoint_in_reciprocal_primitive_cell_by_reciprocal_primitive_cell,
|
Eigen::Vector3d qpoint_in_reciprocal_primitive_cell_by_reciprocal_primitive_cell,
|
||||||
Eigen::Matrix3d super_cell_transformation
|
|
||||||
) -> Eigen::Vector3d
|
) -> Eigen::Vector3d
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
首先需要将 q 点坐标的单位转换为 ModifiedSuperCell 的格矢,可知:
|
首先需要将 q 点坐标的单位转换为 ModifiedSuperCell 的格矢,可知:
|
||||||
QpointByReciprocalModifiedSuperCell = SuperCellMultiplier * QpointByReciprocalPrimitiveCell;
|
QpointByReciprocalModifiedSuperCell =
|
||||||
|
SuperCellMultiplier.cast<double>().asDiagonal() * QpointByReciprocalPrimitiveCell;
|
||||||
接下来考虑将 q 点坐标的单位转换为 SuperCell 的格矢
|
接下来考虑将 q 点坐标的单位转换为 SuperCell 的格矢
|
||||||
ModifiedSuperCell = SuperCellMultiplier * PrimativeCell;
|
ModifiedSuperCell = SuperCellMultiplier.transpose() * PrimativeCell;
|
||||||
SuperCell = SuperCellDeformation * ModifiedSuperCell;
|
SuperCell = SuperCellDeformation * ModifiedSuperCell;
|
||||||
ReciprocalModifiedSuperCell = ModifiedSuperCell.inverse().transpose();
|
ReciprocalModifiedSuperCell = ModifiedSuperCell.inverse().transpose();
|
||||||
ReciprocalSuperCell = SuperCell.inverse().transpose();
|
ReciprocalSuperCell = SuperCell.inverse().transpose();
|
||||||
@@ -28,17 +30,20 @@ void ufo::fold(std::string config_file)
|
|||||||
整理可以得到:
|
整理可以得到:
|
||||||
QpointByReciprocalSuperCell = SuperCellDeformation * QpointByReciprocalModifiedSuperCell;
|
QpointByReciprocalSuperCell = SuperCellDeformation * QpointByReciprocalModifiedSuperCell;
|
||||||
两个式子结合,可以得到:
|
两个式子结合,可以得到:
|
||||||
QpointByReciprocalSuperCell = SuperCellDeformation * SuperCellMultiplier * QpointByReciprocalPrimitiveCell;
|
QpointByReciprocalSuperCell =
|
||||||
|
SuperCellDeformation * SuperCellMultiplier.cast<double>().asDiagonal() * QpointByReciprocalPrimitiveCell;
|
||||||
*/
|
*/
|
||||||
auto qpoint_by_reciprocal_super_cell =
|
auto qpoint_in_reciprocal_primitive_cell_by_reciprocal_super_cell =
|
||||||
(
|
(
|
||||||
super_cell_transformation * qpoint_in_reciprocal_primitive_cell_by_reciprocal_primitive_cell
|
super_cell_deformation * super_cell_multiplier.cast<double>().asDiagonal()
|
||||||
|
* qpoint_in_reciprocal_primitive_cell_by_reciprocal_primitive_cell
|
||||||
).eval();
|
).eval();
|
||||||
/*
|
/*
|
||||||
到目前为止,我们还没有移动过 q 点的坐标。现在,我们将它移动整数个 ReciprocalSuperCell,直到它落在超胞的倒格子中。
|
到目前为止,我们还没有移动过 q 点的坐标。现在,我们将它移动整数个 ReciprocalSuperCell,直到它落在超胞的倒格子中。
|
||||||
这等价于直接取 QpointByReciprocalSuperCell - QpointByReciprocalSuperCell.floor()。
|
这等价于直接取 QpointByReciprocalSuperCell - QpointByReciprocalSuperCell.floor()。
|
||||||
*/
|
*/
|
||||||
return (qpoint_by_reciprocal_super_cell.array() - qpoint_by_reciprocal_super_cell.array().floor()).matrix();
|
return (qpoint_in_reciprocal_primitive_cell_by_reciprocal_super_cell.array()
|
||||||
|
- qpoint_in_reciprocal_primitive_cell_by_reciprocal_super_cell.array().floor()).matrix();
|
||||||
};
|
};
|
||||||
|
|
||||||
biu::Logger::Guard log(config_file);
|
biu::Logger::Guard log(config_file);
|
||||||
@@ -46,7 +51,6 @@ void ufo::fold(std::string config_file)
|
|||||||
for (const auto& qpoint : input.Qpoints) log.info("{} -> {}"_f
|
for (const auto& qpoint : input.Qpoints) log.info("{} -> {}"_f
|
||||||
(
|
(
|
||||||
qpoint,
|
qpoint,
|
||||||
fold(qpoint,
|
fold(input.SuperCellDeformation, input.SuperCellMultiplier, qpoint)
|
||||||
input.SuperCellDeformation * input.SuperCellMultiplier.cast<double>().asDiagonal())
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user