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)))); }
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)))); }
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)))); }