Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix density matrix references in other simulators #6537

Merged
merged 1 commit into from
Mar 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cirq-core/cirq/sim/simulation_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def get_axes(self, qubits: Sequence['cirq.Qid']) -> List[int]:
return [self.qubit_map[q] for q in qubits]

def _perform_measurement(self, qubits: Sequence['cirq.Qid']) -> List[int]:
"""Delegates the call to measure the density matrix."""
"""Delegates the call to measure the `QuantumStateRepresentation`."""
if self._state is not None:
return self._state.measure(self.get_axes(qubits), self.prng)
raise NotImplementedError()
Expand Down
8 changes: 4 additions & 4 deletions cirq-core/cirq/sim/state_vector_simulation_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ def create(
This initializer creates the buffer if necessary.

Args:
initial_state: The density matrix, must be correctly formatted. The data is not
initial_state: The state vector, must be correctly formatted. The data is not
checked for validity here due to performance concerns.
qid_shape: The shape of the density matrix, if the initial state is provided as an int.
dtype: The dtype of the density matrix, if the initial state is provided as an int.
buffer: Optional, must be length 3 and same shape as the density matrix. If not
qid_shape: The shape of the state vector, if the initial state is provided as an int.
dtype: The dtype of the state vector, if the initial state is provided as an int.
buffer: Optional, must be length 3 and same shape as the state vector. If not
provided, a buffer will be created automatically.
Raises:
ValueError: If initial state is provided as integer, but qid_shape is not provided.
Expand Down