Skip to content
Merged
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions cirq-core/cirq/sim/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ def compute_amplitudes(
as an integer array where each integer is formed from measured
qubit values according to `qubit_order` from most to least
significant qubit, i.e. in big-endian ordering.
Binary literals should be input with the prefix 0b or 0B.
For example, 0010 should be input as 0b0010 or 0B0010.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As indicated by the function signature, the bitstrings are supposed to be good old python ints. All valid ways of writing int literals will work, not just 0b-prefixed binary literals.


param_resolver: Parameters to run with the program.
qubit_order: Determines the canonical ordering of the qubits. This
is often used in specifying the initial state, i.e. the
Expand Down Expand Up @@ -215,6 +218,8 @@ def compute_amplitudes_sweep_iter(
as an integer array where each integer is formed from measured
qubit values according to `qubit_order` from most to least
significant qubit, i.e. in big-endian ordering.
Binary literals should be input with the prefix 0b or 0B.
For example, 0010 should be input as 0b0010 or 0B0010.
params: Parameters to run with the program.
qubit_order: Determines the canonical ordering of the qubits. This
is often used in specifying the initial state, i.e. the
Expand Down