forked from qiskit-community/qiskit-machine-learning
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Batching of circuits to overcome memory issues when using statevector…
… simulator (qiskit-community#209) Currently batch_size parameter is ignored if the statevector simulator is used. This leads to unreasonable memory use due to the size of the transpiled circuits, up to 1TB of RAM for 800 by 800 kernel matrix and 20 qubits (see qiskit-terra, issue #6991). This pull request fixes this by transpiling and simulating circuits in batches, never storing the entire 800 circuits. The modification uses batch_size parameter that is already used in non-statevector case. * initial attempt that passes the tests * further improvement * fix formatting * added reno file * Update releasenotes/notes/batch-circuits-statevector-522a842c6f68d954.yaml Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com> * added the word `transpiled` to the dictionary for spellchecker * updated docstring to accurately reflect default batch size Co-authored-by: Anton Dekusar <62334182+adekusar-drl@users.noreply.github.com> Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com> Co-authored-by: Manoel Marques <Manoel.Marques@ibm.com>
- Loading branch information
1 parent
03a1461
commit 445f031
Showing
3 changed files
with
22 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,6 +165,7 @@ toctree | |
todo | ||
traceback | ||
transpilation | ||
transpiled | ||
uncompiled | ||
unitaries | ||
univariate | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
releasenotes/notes/batch-circuits-statevector-522a842c6f68d954.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
fixes: | ||
- | | ||
Fixed a bug in ``QuantumKernel`` where for statevector simulator | ||
all circuits were constructed and transpiled at once, leading to high memory | ||
usage. Now the circuits are batched similarly to how it was previously | ||
done for non-statevector simulators (same flag is used for both now; | ||
previously ``batch_size`` was silently ignored by statevector simulator) |