Projective measurement

Note: Measurement has not yet been implemented for a mixed state. It works only for a pure state kept as a vector.
  1. To specify the binary values to be measured (measurement result) (0 or 1) for measured qubits, use the command:
    M (bit labels, $ x_a~~x_b~~x_c~~... $);
    * The ``bit labels'' is a string in the style of ``1-6'' (qubit 1 to qubit 6) and/or ``1 3 5'' (qubit 1, 3, and 5). $ x_a~~x_b~~...$ is the string of the binary values to be measured for the qubits of ``bit labels''. You may type like this:
    M (1-8, 1 0 0 1 0 1 1 1);
    The qubits that are not measured will properly transit to the state after the measurement.
      
    Example for the read-line mode:
     > init 0 0;
     > H(1); CN(1,2);
     > showb;
    0.707107|00> + 0.707107|11>
     > M(1,0);
     > showb;
    1|00>
    
  2. When you do not specify the result of measurement, the measured qubits result in 0 or 1 with the corresponding probabilities. Such a transition is controlled by a random seed that is produced from the current local time of a computer. For an example, you may try the above example with the line
    M(1);
    instead of M(1,0);.
root
2004-06-15