35 lines
1.3 KiB
C#
35 lines
1.3 KiB
C#
using System;
|
|
using System.Numerics;
|
|
using Skeleton.Algebra.Extensions;
|
|
using Skeleton.Constants;
|
|
|
|
namespace Skeleton.Test;
|
|
[TestFixture]
|
|
public class SUTestFix : BaseTest
|
|
{
|
|
[Test]
|
|
public static void Dim2Test()
|
|
{
|
|
SU2 x = new SU2(
|
|
-0.46729917700515705 - 0.4990694206607689 * AlgebraConstant.I,
|
|
0.31791136143046506 - 0.5640806336119782 * AlgebraConstant.I,
|
|
-0.25266772613116484 - 0.5961657614408675 * AlgebraConstant.I,
|
|
-0.5330307462242154 + 0.669854044098976 * AlgebraConstant.I
|
|
);
|
|
|
|
U2 y = new(
|
|
-0.46729917700515705 - 0.4990694206607689 * AlgebraConstant.I,
|
|
0.31791136143046506 - 0.5640806336119782 * AlgebraConstant.I,
|
|
-0.25266772613116484 - 0.5961657614408675 * AlgebraConstant.I,
|
|
-0.5330307462242154 + 0.669854044098976 * AlgebraConstant.I
|
|
);
|
|
Console.WriteLine(y.Det());
|
|
Assert.IsTrue((x.U * x.U.Hermitian()).IsEqualApprox(C22.One));
|
|
Assert.IsTrue(x.D.Det().IsEqualApprox(1));
|
|
Console.WriteLine(x.D.PythonRepresentation);
|
|
Assert.IsTrue((x.D * x.D.Hermitian()).IsEqualApprox(C22.One));
|
|
Console.WriteLine((x * x.Hermitian()).Representation);
|
|
U2 s = new(Complex.ImaginaryOne, 0, 0, 1);
|
|
Console.WriteLine(s.Representation);
|
|
}
|
|
} |