Function qasmsim::simulate

source ·
pub fn simulate(program: &OpenQasmProgram) -> Result<Computation, RuntimeError>
Expand description

Perform a simulation of the parsed 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;


let program = get_program_ast();
let computation = simulate(&program)?;