def _(problem: Problem, simulator: BraketSimulator, shots, *args, **kwargs): if DeviceActionType.ANNEALING not in simulator.properties.action: raise NotImplementedError( f"{type(simulator)} does not support quantum annealing problems") ir = problem.to_ir() results = simulator.run(ir, shots, *args, *kwargs) return AnnealingQuantumTaskResult.from_object(results)
def _(circuit: Circuit, simulator: BraketSimulator, shots, *args, **kwargs): if DeviceActionType.JAQCD not in simulator.properties.action: raise NotImplementedError( f"{type(simulator)} does not support qubit gate-based programs") validate_circuit_and_shots(circuit, shots) program = circuit.to_ir() qubits = circuit.qubit_count results = simulator.run(program, qubits, shots, *args, **kwargs) return GateModelQuantumTaskResult.from_object(results)
def _(program: Program, simulator: BraketSimulator, shots: Optional[int] = None, *args, **kwargs): if DeviceActionType.OPENQASM not in simulator.properties.action: raise NotImplementedError( f"{type(simulator)} does not support OpenQASM programs") results = simulator.run(program, shots, *args, **kwargs) return GateModelQuantumTaskResult.from_object(results)