Class TestUtilsQuantumChannel

java.lang.Object
com.polytechnik.kgo.TestUtilsQuantumChannel

public class TestUtilsQuantumChannel extends Object
A class to store util functions for quantum channel unit tests.
  • Constructor Details

    • TestUtilsQuantumChannel

      public TestUtilsQuantumChannel()
  • Method Details

    • transformDMThroughQuantumChannel

      public static double[] transformDMThroughQuantumChannel(int nC, int nX, double[][] B, double[] rho)
    • generateRandomDMState

      public static double[] generateRandomDMState(int n, int rank, Random r)
    • generateRandomOrthogonalMatrix

      public static double[] generateRandomOrthogonalMatrix(int n, Random r)
    • generateRandomDMList

      public static List<double[]> generateRandomDMList(int n, Random r, int rank, int nSample)
    • generateDMMappings

      public static List<TestUtilsQuantumChannel.MappingDM> generateDMMappings(int nC, int nX, double[][] B, List<double[]> rhosIn)
    • sqrtLam

      private static double sqrtLam(int ind, double lam)
    • createSqrtDMmappingsFromDM

      public static List<TestUtilsQuantumChannel.MappingDM> createSqrtDMmappingsFromDM(int nC, int nX, List<TestUtilsQuantumChannel.MappingDM> dmMapping)
    • generateRandomQuantumChannel

      public static double[][] generateRandomQuantumChannel(int nS, int nC, int nX, Random r)
      Creates orthogonal random Kraus mapping.
    • testBCanonical

      static void testBCanonical(int nS, int nC, int nX, double[] b, double eps)
    • testBCanonical

      public static void testBCanonical(int nC, int nX, double[][] B, double eps)
    • testBOrthogonality

      static void testBOrthogonality(int nS, int nC, int nX, double[] b, double eps)
    • testBOrthogonality

      public static void testBOrthogonality(int nC, int nX, double[][] B, double eps)
    • testBasisOrthogonality

      static void testBasisOrthogonality(double[][] basis, double eps)
    • testLinearConstraints

      public static void testLinearConstraints(double[] u, double[][] linearConstraints, double eps)
    • testOrthogonality

      public static void testOrthogonality(String txt, int nC, int nX, double[] basis, double eps)
    • testOrthogonalitySkipDiagCheck

      static void testOrthogonalitySkipDiagCheck(String txt, int nC, int nX, double[] basis, double eps)
    • testOrthogonality

      private static void testOrthogonality(String txt, int nC, int nX, double[] basis, double eps, boolean flagTestDiag)
    • getFrobeniusDiffDM

      public static double getFrobeniusDiffDM(int nC, int nX, List<TestUtilsQuantumChannel.MappingDM> dmMapping, double[][] B)
    • getFidelity

      public static double getFidelity(int nC, int nX, List<TestUtilsQuantumChannel.MappingDM> dmMapping, double[][] B)
    • getFidelityCalculation

      private static double getFidelityCalculation(int nC, int nX, List<TestUtilsQuantumChannel.MappingDM> dmMapping, double[][] B, boolean flagSquareResult)
    • getFsimple

      private static double getFsimple(int nC, int nX, List<TestUtilsQuantumChannel.MappingDM> dmMapping, double[][] B, ToDoubleBiFunction<double[],double[]> scaleFactor)
    • getFpp

      public static double getFpp(int nC, int nX, List<TestUtilsQuantumChannel.MappingDM> dmMapping, double[][] B)
    • calcualteppSKfromMappings

      public static double[] calcualteppSKfromMappings(int nC, int nX, List<TestUtilsQuantumChannel.MappingDM> dmMapping)
    • getFscaleRho2

      public static double getFscaleRho2(int nC, int nX, List<TestUtilsQuantumChannel.MappingDM> dmMapping, double[][] B)
    • calcualteScaleRho2SKfromMappings

      public static double[] calcualteScaleRho2SKfromMappings(int nC, int nX, List<TestUtilsQuantumChannel.MappingDM> dmMapping)
    • getFv

      public static double getFv(int nC, int nX, List<TestUtilsQuantumChannel.MappingDM> dmMapping, double[][] B)
    • calcualteSKvfromMappings

      public static double[] calcualteSKvfromMappings(int nC, int nX, List<TestUtilsQuantumChannel.MappingDM> dmMapping)
    • calcualteSKppFromMappings

      private static double[] calcualteSKppFromMappings(int nC, int nX, List<TestUtilsQuantumChannel.MappingDM> dmMapping, ToDoubleBiFunction<double[],double[]> scaleFactor)
    • calcualteSKequivBs

      public static double[] calcualteSKequivBs(int nC, int nX, double[][] B)
      Construct SK (of rank B.length) corresponding to quantum channel B.
    • calcualteSKequivSelectedSolutions

      public static double[] calcualteSKequivSelectedSolutions(int nC, int nX, AlgebraicResult[] h)
      Construct SK (of rank h.length) corresponding to a hierarchy of unitary operators.
    • maxElementDiff

      private static double maxElementDiff(double[] m1, double[] m2)
    • uMatrixDiff

      public static double uMatrixDiff(double[] m1, double[] m2)
      Check matrix diff withing a +- sign.
    • printU

      public static void printU(String txt, int nC, int nX, double[] u)
      Print single matrix.
    • toSingleArray

      public static double[] toSingleArray(int nC, int nX, double[][] B)
    • toArrayOfArrays

      public static double[][] toArrayOfArrays(int nS, int nC, int nX, double[] b)