#P12528. [XJTUPC 2025] 量子力学
[XJTUPC 2025] 量子力学
Description
MCPlayer542 has recently been studying "Quantum Computation and Quantum Information". He is very interested in the representation of quantum states.
Unlike classical bits, a qubit can not only be in the state or the state , but can also be in a superposition state between and .
The state of a quantum system composed of qubits is usually represented by a -dimensional complex vector , where the product of the -th complex number and its conjugate represents the probability of the state of these quantum bits being equal to the binary representation of , after a quantum measurement on the computational basis.
For example, when you perform a quantum measurement on a two-qubit system represented by $|\phi\rangle=[\frac12,\frac12-\frac{\bf{i}}2,0,\frac{\bf{i}}2]^T$, it will be in the state with a probability of , in the state with a probability of $(\frac12-\frac{\bf{i}}2) \times (\frac12+\frac{\bf{i}}2) = \frac14+\frac14 = \frac12$, in the state with a probability of , and in the state with a probability of .
Now he has a quantum state with quantum bits. Please help him calculate the probabilities of each qubit being in the states and after a measurement on the computational basis, respectively.
Input Format
The first line contains a positive integer (), representing the number of quantum bits in the system.
The next lines contain the -th line with two real numbers and , separated by a space, representing the real part and the imaginary part of the -th component of the quantum system vector, respectively.
The data guarantees that the sum of the probabilities of the quantum system being in all states does not exceed an absolute or relative error of from .
Output Format
Output lines, each containing two real numbers and , separated by a space, representing the probabilities of each quantum bit being in the state and the state after the measurement, respectively.
Your output will be considered correct if and only if the absolute or relative error from the correct answer does not exceed .
2
0.5 0
0.5 -0.5
0 0
0 0.5
0.250000000 0.750000000
0.750000000 0.250000000
京公网安备 11011102002149号