qbraid.runtime.native.QirRunner
- class QirRunner(seed=None, exec_path=None)[source]
A sparse simulator that extends the functionality of the qir-runner.
This simulator is a Python wrapper for the qir-runner, a command-line tool for executing compiled QIR files. It uses sparse matrices to represent quantum states and can be used to simulate quantum circuits that have been compiled to QIR. The simulator allows for setting a seed for random number generation and specifying an entry point for the execution.
The qir-runner can be found at: https://github.com/qir-alliance/qir-runner
- seed
The value to use when seeding the random number generator used for quantum simulation.
- Type:
optional, int
- exec_path
Path to the qir-runner executable.
- Type:
str
- version
The version of the qir-runner executable.
- Type:
str
Create a QIR runner simulator.
Methods
__init__
([seed, exec_path])Create a QIR runner simulator.
execute
([qir_program, file_path, ...])Runs the qir-runner executable with the given QIR file and shots.
process_job_data
(job_data)Process the job data based on its status, parse the raw output, and update the job data with measurements and measurement counts.
run
(*args, **kwargs)Alias for execute method.
set_path
(value)Set the qir-runner path with additional validation.
status
()Check the status of the qir-runner executable.
Attributes
qir_runner
Path to the qir-runner executable.
Get the version of the qir-runner executable, caching the result.