I'm very new to quantum mechanics. I'm thinking of writing a quantum computer simulator, would the following work?
- Each qubit is stored as a single bit,
- For each operation, the qubits involved are transformed into a complex vector of amplitudes of size 2^N. This will result in a vector containing 2^N-1 0s and one 1.
- This vector is multiplied by the unitary matrix representing the operation.
- The resulting vector is squared element-wise.
- An outcome is picked using the elements of the result as probabilities and the qubits are set according to this outcome.
I'm not concerned with the running time or the memory cost of the algorithm. What I am concerned about is whether this would result in a physically accurate simulation.