Beispiel #1
0
        private void QubitsSize_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            int selectedSize = (int)QubitsBox.SelectedItem;
            int matrixSize   = (int)Math.Pow(2, selectedSize);

            MatrixDefinition.ResizeGrid(matrixSize, matrixSize);
        }
Beispiel #2
0
 private void ResizeDefinitionMatrix()
 {
     if (StateMatrix.IsChecked.Value)
     {
         //MatrixDefinition.ResizeGrid(Bipartition.DimensionA, Bipartition.DimensionB);
         int matrixRows, matrixCols;
         if (Bipartition.SystemSize % 2 == 0)
         {
             matrixRows = matrixCols = (int)Math.Pow(2, Bipartition.SystemSize / 2);
         }
         else
         {
             matrixRows = (int)Math.Pow(2, (Bipartition.SystemSize - 1) / 2);
             matrixCols = (int)Math.Pow(2, (Bipartition.SystemSize + 1) / 2);
         }
         MatrixDefinition.ResizeGrid(matrixRows, matrixCols);
     }
     else
     {
         int dim = (int)Math.Pow(2, Bipartition.SystemSize);
         MatrixDefinition.ResizeGrid(dim, dim);
     }
 }