Deprecation Note:
The StatevectorSimulator
has been superseded by the AerSimulator
and will be deprecated in the future.
It has same functionality as AerSimulator(method="statevector")
.
The same is true for QasmSimulator
. It has been superseded by AerSimulator
and will be deprecated in the future.
Difference:
According to the documentation here, the difference between simulation methods like statevector
and density_matrix
is:
The AerSimulator
supports a variety of simulation methods, each of which supports a different set of instructions. The method can be set manually using simulator.set_option(method=value)
option, or a simulator backend with a preconfigured method can be obtained directly from the Aer
provider using Aer.get_backend
.
When simulating ideal circuits, changing the method between the exact simulation methods stabilizer
, statevector
, density_matrix
and matrix_product_state
should not change the simulation result (other than usual variations from sampling probabilities for measurement outcomes)
More information is here:
"statevector"
: A dense statevector simulation that can sample measurement outcomes from ideal circuits with all measurements at end of the circuit. For noisy simulations each shot samples a randomly sampled noisy circuit from the noise model.
"density_matrix"
: A dense density matrix simulation that may sample measurement outcomes from noisy circuits with all measurements at end of the circuit.