Esempio n. 1
0
        public CompositeTransform ApplyControlled(IUnitaryTransform g, int controlIndex, int[] targetIndexes, long exp = 1)
        {
            IUnitaryTransform newTrans = new PartialTransform(
                Dimension,
                new CTransform(g),
                new[] { controlIndex }.Concat(targetIndexes).ToArray());

            return(new CompositeTransform(transforms.Add(newTrans.Pow(exp))));
        }
Esempio n. 2
0
        public CompositeTransform Apply(IUnitaryTransform g, int[] qubitIndexes, long exp = 1)
        {
            IUnitaryTransform newTrans = new PartialTransform(Dimension, g, qubitIndexes);

            return(new CompositeTransform(transforms.Add(newTrans.Pow(exp))));
        }
Esempio n. 3
0
        public CompositeTransform Apply(Gate g, int qubitIndex, long exp = 1)
        {
            IUnitaryTransform newTrans = new PartialTransform(Dimension, g, new[] { qubitIndex });

            return(new CompositeTransform(transforms.Add(newTrans.Pow(exp))));
        }