Exemple #1
0
        public void MultiplyBy(UnaryOperation gate, int key)
        {
            var bitLen      = AlgebraUtility.Log2(v.Length);
            var bitPosition = posMap[key];

            v = AlgebraUtility.Multiply(
                gate.GetMatrix(bitLen, bitPosition), v
                );
        }
Exemple #2
0
        public void MultiplyBy(BinaryOperation gate, int key1, int key2)
        {
            var bitLen  = AlgebraUtility.Log2(v.Length);
            var bit1Pos = posMap[key1];
            var bit2Pos = posMap[key2];

            v = AlgebraUtility.Multiply(
                gate.GetMatrix(bitLen, bit1Pos, bit2Pos), v
                );
        }