Provide a way to avoid copying state vector from Cirq
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 18/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- C++
- Estrellas
- 702
- Forks
- 219
- Merge medio
- 1 d 2 h
- PR fusionados (30 d)
- 8
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de quantumlib/qsim
-
`MPSStateSpace::Sample` accesses results out of bounds when the output vector is emptyPosiblemente ocupada @aadityarshah la tomó hace 42 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
quantumlib/qsim#1126 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 57/100
quantumlib/qsim#1146 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 56/100
quantumlib/qsim#1145 ·
Los mantenedores suelen responder en 2 días
-
`MPSStateSpace::SampleOnce` crashes for two-qubit statesPosiblemente ocupada @aadityarshah la tomó hace 40 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
quantumlib/qsim#1129 ·
Los mantenedores suelen responder en 2 días
-
Implement expectation values for the MPS SimulatorPosiblemente ocupada @rupasri118 la tomó hace 36 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
quantumlib/qsim#1122 · 1 comentario ·
Los mantenedores suelen responder en 2 días
Todos los issues de quantumlib/qsim
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
ai_p1 comp-sql-syntax
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
ClickHouse/ClickHouse#133888 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
documentation good first issue
Dificultad 2/5 Medio día Aptitud para principiantes 66/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
jbcoe/cc-protocol#507 ·
Los mantenedores suelen responder en 1 día