Results

Braket.ExpectationMethod
Expectation(o, targets) -> Expectation
Expectation(o) -> Expectation

Constructs a Expectation of an observable o on qubits targets.

o may be one of:

  • Any Observable
  • A String corresponding to an Observable (e.g. "x"`)
  • A Vector{String} in which each element corresponds to an Observable

targets may be one of:

  • A QubitSet
  • A Vector of Ints and/or Qubits
  • An Int or Qubit
  • Absent, in which case the observable o will be applied to all qubits provided it is a single qubit observable.
source
Braket.ExpectationMethod
Expectation(c::Circuit, o, targets) -> Circuit
Expectation(c::Circuit, o) -> Circuit

Constructs 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 String corresponding to an Observable (e.g. "x")
  • A Vector{String} in which each element corresponds to an Observable

targets may be one of:

  • A QubitSet
  • A Vector of Ints and/or Qubits
  • An Int or Qubit
  • Absent, in which case the observable o will 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());
source
Braket.VarianceMethod
Variance(o, targets) -> Variance
Variance(o) -> Variance

Constructs a Variance of an observable o on qubits targets.

o may be one of:

  • Any Observable
  • A String corresponding to an Observable (e.g. "x"`)
  • A Vector{String} in which each element corresponds to an Observable

targets may be one of:

  • A QubitSet
  • A Vector of Ints and/or Qubits
  • An Int or Qubit
  • Absent, in which case the observable o will be applied to all qubits provided it is a single qubit observable.
source
Braket.VarianceMethod
Variance(c::Circuit, o, targets) -> Circuit
Variance(c::Circuit, o) -> Circuit

Constructs 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 String corresponding to an Observable (e.g. "x")
  • A Vector{String} in which each element corresponds to an Observable

targets may be one of:

  • A QubitSet
  • A Vector of Ints and/or Qubits
  • An Int or Qubit
  • Absent, in which case the observable o will 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());
source
Braket.SampleMethod
Sample(o, targets) -> Sample
Sample(o) -> Sample

Constructs a Sample of an observable o on qubits targets.

o may be one of:

  • Any Observable
  • A String corresponding to an Observable (e.g. "x"`)
  • A Vector{String} in which each element corresponds to an Observable

targets may be one of:

  • A QubitSet
  • A Vector of Ints and/or Qubits
  • An Int or Qubit
  • Absent, in which case the observable o will be applied to all qubits provided it is a single qubit observable.
source
Braket.SampleMethod
Sample(c::Circuit, o, targets) -> Circuit
Sample(c::Circuit, o) -> Circuit

Constructs 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 String corresponding to an Observable (e.g. "x")
  • A Vector{String} in which each element corresponds to an Observable

targets may be one of:

  • A QubitSet
  • A Vector of Ints and/or Qubits
  • An Int or Qubit
  • Absent, in which case the observable o will 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());
source
Braket.AmplitudeMethod
Amplitude(states) -> Amplitude

Constructs an Amplitude measurement of states.

states may be one of:

  • A Vector{String}
  • A String

All elements of states must be '0' or '1'.

source
Braket.AmplitudeMethod
Amplitude(c::Circuit, states) -> Circuit

Constructs 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");
source
Braket.ProbabilityMethod
Probability(targets) -> Probability
Probability() -> Probability

Constructs a Probability on qubits targets.

targets may be one of:

  • A QubitSet
  • A Vector of Ints and/or Qubits
  • An Int or Qubit
  • Absent, in which case the measurement will be applied to all qubits.
source
Braket.ProbabilityMethod
Probability(c::Circuit, targets) -> Circuit
Probability(c::Circuit) -> Circuit

Constructs a Probability measurement on qubits targets and adds it as a result to Circuit c.

targets may be one of:

  • A QubitSet
  • A Vector of Ints and/or Qubits
  • An Int or Qubit
  • 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);
source
Braket.DensityMatrixMethod
DensityMatrix(targets) -> DensityMatrix
DensityMatrix() -> DensityMatrix

Constructs a DensityMatrix on qubits targets.

targets may be one of:

  • A QubitSet
  • A Vector of Ints and/or Qubits
  • An Int or Qubit
  • Absent, in which case the measurement will be applied to all qubits.
source
Braket.DensityMatrixMethod
DensityMatrix(c::Circuit, targets) -> Circuit

Constructs a DensityMatrix measurement on qubits targets and adds it as a result to Circuit c.

targets may be one of:

  • A QubitSet
  • A Vector of Ints and/or Qubits
  • An Int or Qubit
  • 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);
source
Braket.StateVectorMethod
StateVector(c::Circuit) -> Circuit

Constructs 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);
source