Skip to content

Add binary literal example to methods of SimulatesAmplitudes class #5818

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

Merged
merged 6 commits into from
Aug 10, 2022
Merged
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
8 changes: 6 additions & 2 deletions cirq-core/cirq/sim/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ def compute_amplitudes(
bitstrings: The bitstrings whose amplitudes are desired, input
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.
significant qubit, i.e. in big-endian ordering. If inputting
a binary literal add the prefix 0b or 0B.
For example: 0010 can be input as 0b0010, 0B0010, 2, 0x2, etc.
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 @@ -214,7 +216,9 @@ def compute_amplitudes_sweep_iter(
bitstrings: The bitstrings whose amplitudes are desired, input
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.
significant qubit, i.e. in big-endian ordering. If inputting
a binary literal add the prefix 0b or 0B.
For example: 0010 can be input as 0b0010, 0B0010, 2, 0x2, etc.
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