Function lattice_qcd_rs::su3::create_matrix_from_2_vector
source · pub fn create_matrix_from_2_vector(
v1: Vector3<Complex>,
v2: Vector3<Complex>
) -> Matrix3<Complex>
Expand description
Create a super::CMatrix3
of the form [v1, v2, v1* x v2*]
where v1* is the conjugate of v1 and
x
is the cross product.
Example
let v1 = Vector3::new(
Complex::new(1_f64, 0_f64),
Complex::new(0_f64, 0_f64),
Complex::new(0_f64, 0_f64),
);
let v2 = Vector3::new(
Complex::new(0_f64, 0_f64),
Complex::new(1_f64, 0_f64),
Complex::new(0_f64, 0_f64),
);
assert_eq_matrix!(
Matrix3::identity(),
create_matrix_from_2_vector(v1, v2),
0.000_000_1_f64
);
let v1 = Vector3::new(
Complex::new(0_f64, 1_f64),
Complex::new(0_f64, 0_f64),
Complex::new(0_f64, 0_f64),
);
let v2 = Vector3::new(
Complex::new(0_f64, 0_f64),
Complex::new(1_f64, 0_f64),
Complex::new(0_f64, 0_f64),
);
let m = Matrix3::new(
Complex::new(0_f64, 1_f64),
Complex::new(0_f64, 0_f64),
Complex::new(0_f64, 0_f64),
// ---
Complex::new(0_f64, 0_f64),
Complex::new(1_f64, 0_f64),
Complex::new(0_f64, 0_f64),
// ---
Complex::new(0_f64, 0_f64),
Complex::new(0_f64, 0_f64),
Complex::new(0_f64, -1_f64),
);
assert_eq_matrix!(m, create_matrix_from_2_vector(v1, v2), 0.000_000_1_f64);