1
$\begingroup$

My circuit is adding two 128 bits number and each input has been stored in 128 length quantum register (total 128*3 + carry in and out, 386). For calculation purpose I am using AER's different simulator options.

length=128

a = QuantumRegister(length)
b = QuantumRegister(length) 
s = QuantumRegister(length)

cout = QuantumRegister(1) 
cin = QuantumRegister(1)

simulator1 = AerSimulator(method='statevector')
simulator2 = AerSimulator(method='extended_stabilizer')
simulator3 = AerSimulator(method='matrix_product_state') 
simulator4 = AerSimulator(method='stabilizer')

simulator1 (qbits 30) and simulator2 (qbits 63) didn't work while simulator3 (qibts 63) and simulator4(qbits 10000) are working and displaying results (regardless of result's correctness). My question is how come simulator3, having only 63 qbits, is running my program without stating any max qbit error? What other things should we consider while selection of simulator?

Also I am planning to get two 1TB RAM GPUs for some ciruit parallel simulation. The number of qbits any system is capable of generating has this farmula 2^n * 8 bytes for RAM consumption which has restricted circuits till 40 qbits on my new setup. But my current system has RAM only 32 GB and it is simulating 384 qbits (mentioned above).

So my actual confusion revolves around number of qbits actually used in circuit and simulator capability along with RAM requirements.

Any help will be appreciated.

$\endgroup$

1 Answer 1

1
$\begingroup$

To get the number of qubits for an Aer simulator we use:

simulator.configuration().n_qubits

For most simulation methods this value is estimated based on the available memory. For matrix_product_state, however, n_qubits is always $63$ regardless of how much memory you have. In fact, this number is hardcoded:

enter image description here

The main factor that decides the amount of memory needed to simulate a given circuit using MPS simulator is the amount of entanglement present in that circuit, which can roughly be estimated by the number of two-qubit gates.

According to Qiskit Aer tutorial (here):

Note that two-qubit operations may increase the size of the respective tensors. The sizes are determined by the Schmidt coefficient. Intuitively, the Schmidt coefficients provide a measurement of the entanglement of the system, and therefore determine the performance of the circuit.

In the worst case, the tensors may grow exponentially. However, the size of the overall structure remains 'small' for circuits that do not have 'many' two-qubit gates. This allows much more efficient operations in circuits with relatively 'low' entanglement. Characterizing when to use this method over other methods is a subject of current research.

$\endgroup$

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.