44 lines
1.3 KiB
C#
44 lines
1.3 KiB
C#
using System;
|
|
using System.Linq;
|
|
using System.Numerics;
|
|
using Skeleton.Algebra.Extensions;
|
|
using Skeleton.Samples;
|
|
using Skeleton.Utils;
|
|
using Skeleton.Utils.Helpers;
|
|
|
|
namespace Skeleton.Test;
|
|
[TestFixture]
|
|
public class CayleySU4Test : BaseTest
|
|
{
|
|
[DatapointSource]
|
|
private static readonly LieSU4[] Data = 80
|
|
.WithSeed(Seed)
|
|
.ScaleSamples(-1, 1)
|
|
.LieSU4LogSU4Samples()
|
|
.ToArray();
|
|
private static Action<LieSU4> OnFail = x => Console.WriteLine(x.CSharpRepresentation);
|
|
[Theory]
|
|
public static void TestCayleyForLieSU4(LieSU4 data)
|
|
{
|
|
Action<LieSU4> rawTest = x =>
|
|
{
|
|
U4 cN = x.CayleyNegative();
|
|
Assert.IsTrue((cN * cN.Hermitian()).IsEqualApprox(C44.One));
|
|
};
|
|
rawTest.OnFail(OnFail)(data);
|
|
}
|
|
|
|
[Theory]
|
|
public static void TestCayleyUnitary(LieSU4 data)
|
|
{
|
|
U4 cN = data.CayleyNegative();
|
|
U4 cP = data.CayleyPositive();
|
|
var udN = cN.EigenDecomposition();
|
|
var udP = cP.EigenDecomposition();
|
|
//Console.WriteLine((cN - cP.Conj()).PythonRepresentation);
|
|
Assert.IsTrue(cN.Det().IsEqualApprox(Complex.Conjugate(cP.Det())));
|
|
Console.WriteLine($"{cN.Det()} =x= {cP.Det()}");
|
|
Console.WriteLine($"{udN.J.Det()} =x= {udP.J.Det()}");
|
|
}
|
|
|
|
} |