Provide a way to avoid copying state vector from Cirq
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 18/100
Piste de recherche
The failing call path runs through qsimcirq/qsim_simulator.py in simulate_sweep_iter, which builds a cirq.StateVectorSimulationState; the copy itself happens inside Cirq's state_vector_simulation_state.py, outside this repo. Read how QSimSimulator passes initial_state and what _simulate_impl returns, then decide what a user-facing option would look like. Done means a proposal agreed with maintainers, since the thread has no decision and the request is open-ended.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
What is your request or suggestion?
An internal user reported getting the following error with a 40 qubit simulation:
Traceback (most recent call last):
File "/tmp/test/exact_sim.py", line 23, in <module>
psi = qsim.simulate(circuit, qubit_order=qubits).state_vector()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/venv/lib64/python3.12/site-packages/cirq/sim/simulator.py", line 496, in simulate
return self.simulate_sweep(
^^^^^^^^^^^^^^^^^^^^
File "/tmp/venv/lib64/python3.12/site-packages/cirq/sim/simulator.py", line 511, in simulate_sweep
return list(self.simulate_sweep_iter(program, params, qubit_order, initial_state))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/venv/lib64/python3.12/site-packages/qsimcirq/qsim_simulator.py", line 560, in simulate_sweep_iter
final_state = cirq.StateVectorSimulationState(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/venv/lib64/python3.12/site-packages/cirq/sim/state_vector_simulation_state.py", line 351, in __init__
state = _BufferedStateVector.create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/venv/lib64/python3.12/site-packages/cirq/sim/state_vector_simulation_state.py", line 84, in create
state_vector = state_vector.copy()
^^^^^^^^^^^^^^^^^^^
numpy._core._exceptions._ArrayMemoryError: Unable to allocate 8.00 TiB for an array with shape (2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2) and data type complex64
They were able to work around the problem by calling QSimSimulator()._simulate_impl() directly.
What solution or approach do you envision?
We should investigate whether the copy can be handled in a more user-friendly way.
How urgent is this for you?
P2 – needed within two quarters
- Langage dominant
- C++
- Étoiles
- 702
- Forks
- 219
- Merge moyen
- 1 j 2 h
- PR mergées (30 j)
- 3
Préparer son environnement
- Fournit un Dockerfile ou un fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de quantumlib/qsim
-
`MPSStateSpace::Sample` accesses results out of bounds when the output vector is emptyPeut-être pris @aadityarshah l’a pris il y a 42 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
quantumlib/qsim#1126 ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 57/100
quantumlib/qsim#1146 ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 56/100
quantumlib/qsim#1145 ·
-
`MPSStateSpace::SampleOnce` crashes for two-qubit statesPeut-être pris @aadityarshah l’a pris il y a 40 jours. Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 58/100
quantumlib/qsim#1129 ·
-
Implement expectation values for the MPS SimulatorPeut-être pris @rupasri118 l’a pris il y a 36 jours. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 55/100
quantumlib/qsim#1122 · 1 commentaire ·
Toutes les issues de quantumlib/qsim
Issues similaires
-
Tests: parallel pyinstallcheck runs oversubscribe the machine through nested TBB and BLAS poolsPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
CefRequestContext::ClearHttpCache crashes with a null callback, though the callback is optionalOuvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
chromiumembedded/cef#4376 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
itinance/react-native-fs#1270 ·
-
area-CodeGen-coreclr untriaged
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
dotnet/runtime#138181 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
yuaotian/antigravity-proxy#181 ·