Fix: Unitary Decomposition -> Conj inplace not handled correct
This commit is contained in:
@@ -110,10 +110,31 @@ public static partial class CategoryOf<TDimension>
|
||||
return new(U, logd);
|
||||
}
|
||||
|
||||
/*/// <inheritdoc />
|
||||
public override JDPair<OnField<Complex>.FMatrix> EigenDecomposition() => this.UnitaryDecomposition();*/
|
||||
/*
|
||||
* /// <inheritdoc />
|
||||
* public override JDPair<OnField<Complex>.FMatrix> EigenDecomposition() => this.UnitaryDecomposition();
|
||||
* */
|
||||
|
||||
internal override void UnitaryFix(OnField<Complex>.FMatrix a) => a.UnitaryFix();
|
||||
protected override bool NeedPreNormalFix() => !Property.IsUnitary;
|
||||
protected override void PreNormalConstructionFix()
|
||||
{
|
||||
if (Property.IsDiagonal)
|
||||
{
|
||||
for (int i = 1; i <= Dim; i++)
|
||||
this[i, i] /= (this[i, i] * Complex.Conjugate(this[i, i]));
|
||||
}
|
||||
else
|
||||
{
|
||||
this[1] = this[1].Normalize;
|
||||
for (int i = 2; i <= Dim; i++)
|
||||
{
|
||||
for (int j = 1; j < i; j++)
|
||||
this[i] -= this[i].ProjectionOn(this[j]);
|
||||
this[i] = this[i].Normalize;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user