// CONSTRUCTOR public QuantumStateComposed(params IQuantumState[] states) : base(generateNumLevels(states)) { _collection = QuantumStateFactory.generateStateCollection(); addStates(states); // Changes internal state of 'states' }
public QuBasis(IQuantumBasisElementCollection elements, IQuantumStateCollection states) : base() { _elements = elements; _states = states; checkNumElements(); }
static QuantumStateFactory() { IQuantumState state_A1 = QuantumStateFactory.generateStateSimple((int)InformationArity.Binary); IQuantumStateDebugger debugger_A1 = state_A1.Debugger; debugger_A1.setCoefficientInternal(ComplexNumberFactory.GenerateIdentity(), 0); debugger_A1.setCoefficientInternal(ComplexNumberFactory.GenerateZero(), 1); IQuantumState state_A2 = QuantumStateFactory.generateStateSimple(2); IQuantumStateDebugger debugger_A2 = state_A2.Debugger; debugger_A2.setCoefficientInternal(ComplexNumberFactory.GenerateZero(), 0); debugger_A2.setCoefficientInternal(ComplexNumberFactory.GenerateIdentity(), 1); _UsualStateCollection_A = QuantumStateFactory.generateStateCollection(state_A1, state_A2); IQuantumState state_B1 = QuantumStateFactory.generateStateSimple((int)InformationArity.Binary); IQuantumStateDebugger debugger_B1 = state_B1.Debugger; debugger_B1.setCoefficientInternal(ComplexNumberFactory.GenerateIdentity(), 0); debugger_B1.setCoefficientInternal(ComplexNumberFactory.GenerateIdentity(), 1); IQuantumState state_B2 = QuantumStateFactory.generateStateSimple(2); IQuantumStateDebugger debugger_B2 = state_B2.Debugger; debugger_B2.setCoefficientInternal(ComplexNumberFactory.GenerateIdentity(), 0); debugger_B2.setCoefficientInternal(ComplexNumberFactory.GenerateSimetry(), 1); _UsualStateCollection_B = QuantumStateFactory.generateStateCollection(state_B1, state_B2); }
static FactoryQuantumState() { IQuantumState state_A1 = FactoryQuantumState.generateStateSimple((int)InformationArity.Binary); IQuantumStateDebugger debugger_A1 = state_A1.generateQuantumDebugger(); debugger_A1.setCoefficientInternal(FactoryComplexNumber.generateIdentity(), 0); debugger_A1.setCoefficientInternal(FactoryComplexNumber.generateZero(), 1); IQuantumState state_A2 = FactoryQuantumState.generateStateSimple(2); IQuantumStateDebugger debugger_A2 = state_A2.generateQuantumDebugger(); debugger_A2.setCoefficientInternal(FactoryComplexNumber.generateZero(), 0); debugger_A2.setCoefficientInternal(FactoryComplexNumber.generateIdentity(), 1); _UsualStateCollection_A = FactoryQuantumState.generateStateCollection(state_A1, state_A2); IQuantumState state_B1 = FactoryQuantumState.generateStateSimple((int)InformationArity.Binary); IQuantumStateDebugger debugger_B1 = state_B1.generateQuantumDebugger(); debugger_B1.setCoefficientInternal(FactoryComplexNumber.generateIdentity(), 0); debugger_B1.setCoefficientInternal(FactoryComplexNumber.generateIdentity(), 1); IQuantumState state_B2 = FactoryQuantumState.generateStateSimple(2); IQuantumStateDebugger debugger_B2 = state_B2.generateQuantumDebugger(); debugger_B2.setCoefficientInternal(FactoryComplexNumber.generateIdentity(), 0); debugger_B2.setCoefficientInternal(FactoryComplexNumber.generateSimetry(), 1); _UsualStateCollection_B = FactoryQuantumState.generateStateCollection(state_B1, state_B2); }
public static IQuantumBasis generateBasis(IQuantumBasisElementCollection elements, IQuantumStateCollection states) { return new QuBasis(elements, states); }