liveBook · Manning

State vector simulator

As explained in Quantum Programming in Depth

A full-state simulator represents every amplitude of a quantum state vector when simulating a quantum program.

A state vector simulator represents every amplitude in a quantum program’s state as a vector of complex numbers. Applying gates or measurements updates this vector, potentially requiring work across all of its elements. section 9.3

Use full-state simulation with these performance considerations:

  • Expect simulation time to depend heavily on the number of allocated qubits because the state-vector size grows exponentially. section 9.3
  • Compare simulator timings cautiously: classical simulation work does not predict execution time on a quantum computer, where gates act physically on a few qubits. section 9.3
  • Distinguish full-state behavior from sparse simulation, whose cost depends primarily on the manipulated basis states. section 9.3
Table 9.1 Simulation times for different solutions to the N queens puzzle
Algorithm Qiskit run time Q# run time
Section 8.2 137 sec 16 sec
Section 8.3 < 1 sec 20 sec

Compare Qiskit and Q# simulation times for two implementations of the N queens puzzle. section 9.3

How Quantum Programming in Depth covers it

How deep it goes
Explains complex-vector state maintenance and exponential scaling, but stops short of gate-update implementation details.
Examples
Compares Qiskit and Q# runtimes for two N queens solutions, including a 137-second versus under-one-second contrast.
What it assumes
Assumes familiarity with qubits, quantum gates, measurements, and quantum programs; does not establish those concepts from zero.
What you can do after
Evaluate simulator performance and avoid treating classical simulation time as a direct forecast of quantum execution time.
How it connects
Connects quantum gates, measurements, Qiskit, Q# simulation, sparse simulation, and quantum-computer execution.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Quantum Programming in Depth. The section links point to the parts of the book it draws on.