3
$\begingroup$

As a newcomer to quantum computing, I have a question about the simulation of a quantum computer using Qiskit on a classical computer. Does Qiskit actually perform matrix manipulations in its simulation, even though the number of qubits makes these calculations exponentially difficult? Or does it rely on making logical judgments to perform the calculations, such as recognizing that the $CNOT$ gate applied to the state $|11\rangle$ results in the state $|10\rangle$, which can be easily determined through logical judgment rather than matrix manipulation?

In other words, is there a faster (mathematical) way to simulate quantum computing on a classical computer?

$\endgroup$

2 Answers 2

2
$\begingroup$

No matter how you do it, the cost will be exponential. Your simple example of CNOT being applied to 11, rapidly gets more complicated when you want arbitrary gates, on arbitrary entangled states.

The mathematical essence of the simulator is: $\exp(-iHt)$.

$\endgroup$
2
2
$\begingroup$

Single- and two-qubit gates can be applied to state vectors with linear complexity (Python example here). Of course, the size of a full state vector grows exponentially with the number of qubits.

The venerable libquantum implemented a sparse representation. In your example, if you had 1,000 qubits but only applied a single Hadamard gate to a single qubit, libquantum would indeed only store representatives of 2 states. For most text book algorithms, this sparse representation is super fast, especially because those algorithm tend to have many close-to-zero states (which libquantum tosses away).

In the general case, though, the complexity will be exponential in space.

$\endgroup$
1
  • $\begingroup$ I was just reading your lovely book about quantum computing programming! It's amazing to get your answer here! Thank you Hundt, respect to your work. $\endgroup$ Feb 11, 2023 at 23:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.