private void CalculateSubsystemState(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(DiscardedQubitsBox.Text))
            {
                return;
            }
            StateOperator state           = StateOperator.FromQuantumState(Layer.GetSystemState());
            List <int>    discardedQubits = new List <int>();
            string        qubits          = DiscardedQubitsBox.Text.Replace(",", "");

            for (int i = 0; i < qubits.Length; i++)
            {
                discardedQubits.Add(Convert.ToInt32(qubits[i] - 48));
            }
            SubState = state.PartialTrace(discardedQubits);
            SubsystemState.ResizeGrid(SubState.RowDimension, SubState.ColumnDimension);
            for (int i = 0; i < SubState.RowDimension; i++)
            {
                for (int j = 0; j < SubState.ColumnDimension; j++)
                {
                    SubsystemState[i, j] = ComplexParser.ToString(SubState[i, j], 4);
                }
            }
            SubsystemStateGrid.Visibility = Visibility.Visible;
            if (SubState.Size == 1)
            {
                ExamineSubsystemButton.IsEnabled = false;
            }
        }
Exemplo n.º 2
0
 public override void DisplayResults(QuantumState state, SystemBipartition bipartition)
 {
     DisplayResults(StateOperator.FromQuantumState(state), bipartition);
 }
Exemplo n.º 3
0
        //public ComputableCrossNormCriterion(QuantumState state) : base(state) { }


        //public ComputableCrossNormCriterion(StateOperator @operator) : base(@operator) { }


        public override void Evaluate(QuantumState state, SystemBipartition bipartition)
        {
            Evaluate(StateOperator.FromQuantumState(state), bipartition);
        }