NoisyResults
- class pulser_simulation.simresults.NoisyResults(run_output, size, basis_name, sim_times, n_measures)
Bases:
SimulationResults
[SampledResult
]Results of a noisy simulation run of a pulse sequence.
Contrary to a CoherentResults object, this object contains a list of Counters describing the state distribution at the time it was created by using QutipEmulator.run() with a noisy simulation. Contains methods for studying the populations and extracting useful information from them.
Attributes
Probability distribution of the bitstrings.
Measured states as a list of diagonal qutip.Qobj.
Methods
Returns the expectation values of operators in obs_list.
Get the final state of the simulation as a diagonal density matrix.
Gets the state at time t as a diagonal density matrix.
Raises ValueError if the value is not present.
Plots the expectation value of a given operator op.
Returns the result of multiple measurements of the final state.
Returns the result of multiple measurements at time t.
Signatures
- count(value) integer -- return number of occurrences of value
- expect(obs_list)
Returns the expectation values of operators in obs_list.
- Parameters:
obs_list (
Sequence
[Qobj
| ArrayLike]) – Input observable list. ArrayLike objects will be converted to qutip.Qobj.- Return type:
list
[float
|complex
| ArrayLike]- Returns:
Expectation values of obs_list.
- get_final_state()
Get the final state of the simulation as a diagonal density matrix.
Note
This is not the density matrix of the system, but is a convenient way of computing expectation values of observables.
- Return type:
Qobj
- Returns:
States probability distribution as a density matrix.
- get_state(t, t_tol=0.001)
Gets the state at time t as a diagonal density matrix.
Note
This is not the density matrix of the system, but is a convenient way of computing expectation values of observables.
- Parameters:
t (
float
) – Time (in µs) at which to return the state.t_tol (
float
, default:0.001
) – Tolerance for the difference between t and closest time.
- Return type:
Qobj
- Returns:
States probability distribution as a diagonal density matrix.
- index(value[, start[, stop]]) integer -- return first index of value.
Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
- plot(op, fmt='.', label='', error_bars=True)
Plots the expectation value of a given operator op.
Note
The observable must be diagonal.
- Parameters:
op (
Qobj
) – Operator whose expectation value is wanted.fmt (
str
, default:'.'
) – Curve plot format.label (
str
, default:''
) – y-Axis label.error_bars (
bool
, default:True
) – Choose to display error bars.
- Return type:
None
- sample_final_state(N_samples=1000)
Returns the result of multiple measurements of the final state.
- Parameters:
N_samples (
int
, default:1000
) – Number of samples to return.- Return type:
Counter
- Returns:
Sample distribution of bitstrings corresponding to measured quantum states at the end of the simulation.
- sample_state(t, n_samples=1000, t_tol=0.001)
Returns the result of multiple measurements at time t.
- Parameters:
t (
float
) – Time at which the state is sampled (in µs).n_samples (
int
, default:1000
) – Number of samples to return.t_tol (
float
, default:0.001
) – Tolerance for the difference between t and closest time.
- Return type:
Counter
- Returns:
Sample distribution of bitstrings corresponding to measured quantum states at time t.
- property results: list[Counter]
Probability distribution of the bitstrings.
- property states: list[Qobj]
Measured states as a list of diagonal qutip.Qobj.