Function qasmsim::simulate_with_shots
source · pub fn simulate_with_shots(
program: &OpenQasmProgram,
shots: usize
) -> Result<Computation, RuntimeError>
Expand description
Perform shots
number of simulations of the parsed proram program
.
Errors
Simulate can fail during runtime returning an Err
variant with a value
of the RuntimeError
type. RuntimeError
is a sourceless error. It
can be related to a source code and converted into a more useful
QasmSimError
value.
Examples
Basic usage requires a valid AST as input. You can use
parse_and_link()
.
use qasmsim::simulate_with_shots;
let program = get_program_ast();
let computation = simulate_with_shots(&program, 1024)?;