Results
Braket.Result — TypeResultAbstract type representing a measurement to perform on a Circuit.
See also: Expectation, Variance, Sample, Probability, DensityMatrix, and Amplitude.
Braket.Expectation — TypeExpectation <: ResultStruct which represents a expectation measurement on a Circuit.
Braket.Expectation — MethodExpectation(o, targets) -> Expectation
Expectation(o) -> ExpectationConstructs a Expectation of an observable o on qubits targets.
o may be one of:
- Any
Observable - A
Stringcorresponding to anObservable(e.g."x"`) - A
Vector{String}in which each element corresponds to anObservable
targets may be one of:
Braket.Expectation — MethodExpectation(c::Circuit, o, targets) -> Circuit
Expectation(c::Circuit, o) -> CircuitConstructs a Expectation of an observable o on qubits targets and adds it as a result to Circuit c.
o may be one of:
- Any
Observable - A
Stringcorresponding to anObservable(e.g. "x") - A
Vector{String}in which each element corresponds to anObservable
targets may be one of:
- A
QubitSet - A
VectorofInts and/orQubits - An
IntorQubit - Absent, in which case the observable
owill be applied to all qubits provided it is a single qubit observable.
Examples
julia> c = Circuit();
julia> c = H(c, collect(0:10));
julia> c = Expectation(c, Braket.Observables.Z(), 0);
julia> c = Expectation(c, Braket.Observables.X());Braket.Variance — TypeVariance <: ResultStruct which represents a variance measurement on a Circuit.
Braket.Variance — MethodVariance(o, targets) -> Variance
Variance(o) -> VarianceConstructs a Variance of an observable o on qubits targets.
o may be one of:
- Any
Observable - A
Stringcorresponding to anObservable(e.g."x"`) - A
Vector{String}in which each element corresponds to anObservable
targets may be one of:
Braket.Variance — MethodVariance(c::Circuit, o, targets) -> Circuit
Variance(c::Circuit, o) -> CircuitConstructs a Variance of an observable o on qubits targets and adds it as a result to Circuit c.
o may be one of:
- Any
Observable - A
Stringcorresponding to anObservable(e.g. "x") - A
Vector{String}in which each element corresponds to anObservable
targets may be one of:
- A
QubitSet - A
VectorofInts and/orQubits - An
IntorQubit - Absent, in which case the observable
owill be applied to all qubits provided it is a single qubit observable.
Examples
julia> c = Circuit();
julia> c = H(c, collect(0:10));
julia> c = Variance(c, Braket.Observables.Z(), 0);
julia> c = Variance(c, Braket.Observables.X());Braket.Sample — TypeSample <: ResultStruct which represents a sample measurement on a Circuit.
Braket.Sample — MethodSample(o, targets) -> Sample
Sample(o) -> SampleConstructs a Sample of an observable o on qubits targets.
o may be one of:
- Any
Observable - A
Stringcorresponding to anObservable(e.g."x"`) - A
Vector{String}in which each element corresponds to anObservable
targets may be one of:
Braket.Sample — MethodSample(c::Circuit, o, targets) -> Circuit
Sample(c::Circuit, o) -> CircuitConstructs a Sample of an observable o on qubits targets and adds it as a result to Circuit c.
o may be one of:
- Any
Observable - A
Stringcorresponding to anObservable(e.g. "x") - A
Vector{String}in which each element corresponds to anObservable
targets may be one of:
- A
QubitSet - A
VectorofInts and/orQubits - An
IntorQubit - Absent, in which case the observable
owill be applied to all qubits provided it is a single qubit observable.
Examples
julia> c = Circuit();
julia> c = H(c, collect(0:10));
julia> c = Sample(c, Braket.Observables.Z(), 0);
julia> c = Sample(c, Braket.Observables.X());Braket.Amplitude — TypeAmplitude <: ResultStruct which represents an amplitude measurement on a Circuit.
Braket.Amplitude — MethodAmplitude(states) -> AmplitudeConstructs an Amplitude measurement of states.
states may be one of:
- A
Vector{String} - A
String
All elements of states must be '0' or '1'.
Braket.Amplitude — MethodAmplitude(c::Circuit, states) -> CircuitConstructs an Amplitude measurement of states and adds it as a result to Circuit c.
states may be of type:
Vector{String}String
All elements of states must be '0' or '1'.
Examples
julia> c = Circuit();
julia> c = H(c, collect(0:3));
julia> c = Amplitude(c, "0000");Braket.Probability — TypeProbability <: ResultStruct which represents a probability measurement on a Circuit.
Braket.Probability — MethodProbability(targets) -> Probability
Probability() -> ProbabilityConstructs a Probability on qubits targets.
targets may be one of:
Braket.Probability — MethodProbability(c::Circuit, targets) -> Circuit
Probability(c::Circuit) -> CircuitConstructs a Probability measurement on qubits targets and adds it as a result to Circuit c.
targets may be one of:
- A
QubitSet - A
VectorofInts and/orQubits - An
IntorQubit - Absent, in which case the measurement will be applied to all qubits of
c.
Examples
julia> c = Circuit();
julia> c = H(c, collect(0:3));
julia> c = Probability(c, 2);Braket.DensityMatrix — TypeDensityMatrix <: ResultStruct which represents a densitymatrix measurement on a Circuit.
Braket.DensityMatrix — MethodDensityMatrix(targets) -> DensityMatrix
DensityMatrix() -> DensityMatrixConstructs a DensityMatrix on qubits targets.
targets may be one of:
Braket.DensityMatrix — MethodDensityMatrix(c::Circuit, targets) -> CircuitConstructs a DensityMatrix measurement on qubits targets and adds it as a result to Circuit c.
targets may be one of:
- A
QubitSet - A
VectorofInts and/orQubits - An
IntorQubit - Absent, in which case the measurement will be applied to all qubits of
c.
Examples
julia> c = Circuit();
julia> c = H(c, collect(0:3));
julia> c = DensityMatrix(c, 2);Braket.StateVector — TypeStateVector <: ResultStruct which represents a state vector measurement on a Circuit.
Braket.StateVector — MethodStateVector(c::Circuit) -> CircuitConstructs a StateVector measurement on all qubits of c and adds it as a result to Circuit c.
Examples
julia> c = Circuit();
julia> c = H(c, collect(0:3));
julia> c = StateVector(c);