示例#1
0
    public void ConstructOutput()
    {
        //We need a QiskitSimulator since it can not only run qiskit but also interpret the output from qiskit
        QiskitSimulator simulator = new QiskitSimulator();

        //Preparing the array where the probabilities are stored on
        double[] returnValue = new double[MathHelper.IntegerPower(2, 16)];

        //Here we use the ability from the simulator to read the proabilities from the qiskit output string into our double array
        simulator.ReadProbabilities(ref returnValue, SingleFile.text, Normalization, RecalculateNormalization);

        //We now interpret the probabilities as an image to visualize them
        Output = QuantumImageCreator.GetGreyTextureDirect(returnValue, Dimension, Dimension);
        TargetImage.texture = Output;
    }
示例#2
0
    public void ConstructOutputCombined()
    {
        //Preparing an array of strings to give the simulator
        string[] files = new string[MultipleFiles.Length];
        for (int i = 0; i < MultipleFiles.Length; i++)
        {
            files[i] = MultipleFiles[i].text;
        }

        //We need a QiskitSimulator since it can not only run qiskit but also interpret the output from qiskit
        QiskitSimulator simulator = new QiskitSimulator();

        //Preparing the array where the probabilities are stored on
        double[] returnValue = new double[MathHelper.IntegerPower(2, 16)];

        //Here we use the ability from the simulator to read the proabilities from the qiskit output strings into our double array
        simulator.ReadProbabilities(ref returnValue, files, Normalization, RecalculateNormalization);


        //We now interpret the probabilities as an image to visualize them
        Output = QuantumImageCreator.GetGreyTextureDirect(returnValue, Dimension, Dimension);
        TargetImage.texture = Output;
    }