/// <summary>
        /// Getting a grey scale texture for a given quantum circuit (which should represent an image) directly without using python.
        /// Is faster than python versions but does not support logarithmic encoding yet and may still contain some errors.
        /// </summary>
        /// <param name="quantumCircuit">The quantum circuit with the grey scale image representation</param>
        /// <param name="width">The width of the image</param>
        /// <param name="height">The height of the image</param>
        /// <param name="renormalize">If the image (colors) should be renormalized. (Giving it the highest possible saturation / becomes most light) </param>
        /// <param name="useLog">If logarithmic encoding is chosen DOES NOTHING (at the moment)</param>
        /// <returns>A texture showing the encoded image.</returns>
        public static Texture2D GetGreyTextureDirect(QuantumCircuit quantumCircuit, int width, int height, bool renormalize = false, bool useLog = false, SimulatorBase simulator = null)
        {
            //TODO Make version with only floats (being faster needing less memory)
            double[,] imageData = QuantumImageHelper.CircuitToHeight2D(quantumCircuit, width, height, renormalize, simulator);

            return(QuantumImageHelper.CalculateGreyTexture(imageData));
        }
示例#2
0
        /// <summary>
        /// OLD VERSION use the faster version instead.
        /// Getting a colored texture for given quantum circuits (each one representing 1 color channel of an image) directly without using python.
        /// Is faster than python versions but does not support logarithmic encoding yet and may still contain some errors.
        /// </summary>
        /// <param name="redCircuit">The quantum circuit which represents the red channel of the image.</param>
        /// <param name="greenCircuit">The quantum circuit which represents the green channel of the image.</param>
        /// <param name="blueCircuit">The quantum circuit which represents the blue channel of the image.</param>
        /// <param name="width">The width of the image</param>
        /// <param name="height">The height of the image</param>
        /// <param name="renormalize">If the image (colors) should be renormalized. (Giving it the highest possible saturation / becomes most light) </param>
        /// <param name="useLog">If logarithmic encoding is chosen DOES NOTHING (at the moment)</param>
        /// <returns>A texture showing the encoded image.</returns>
        public static Texture2D GetColoreTextureDirect(QuantumCircuit redCircuit, QuantumCircuit greenCircuit, QuantumCircuit blueCircuit, int width, int height, bool renormalize = false, bool useLog = false)
        {
            double[,] redData   = QuantumImageHelper.CircuitToHeight2D(redCircuit, width, height, renormalize);
            double[,] greenData = QuantumImageHelper.CircuitToHeight2D(greenCircuit, width, height, renormalize);
            double[,] blueData  = QuantumImageHelper.CircuitToHeight2D(blueCircuit, width, height, renormalize);

            return(QuantumImageHelper.CalculateColorTexture(redData, greenData, blueData));
        }