Backends¶
To use the emulator, a target backend needs to be defined which a simulation task can be run against. Emulator backends are selected and interfaced with via the Backend object.
The following backends are currently implemented within the emulator:
Name |
Functionality |
Compatibility |
---|---|---|
permanent |
Probability amplitude, probability distribution |
Analyzer, Sampler, Simulator |
slos |
Probability distribution |
Sampler |
Usage¶
To use a backend, it must first be defined by supplying the name to the Backend
object. In this case the permanent backend is selected.
backend = emulator.Backend("permanent")
A target task, such as the Simulator
, should then be configured.
circuit = lw.Unitary(lw.random_unitary(4, seed = 11))
state = lw.State([1, 0, 1, 0])
sim = lw.Simulator(circuit, state)
The task can then be run against the backend with the run
method, this will return a results object.
results = backend.run(sim)
The results can then be viewed using one of the built-in methods, such as plot.
results.plot()
