Skip to content
This repository has been archived by the owner on Aug 21, 2023. It is now read-only.

Minor improvements to opflow tutorial #1308

Merged
merged 2 commits into from
May 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions tutorials/operators/01_operator_flow.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"`StateFn`s carry a coefficient. This allows us multiply states by a scalar, and so to construct sums."
"`StateFn`s carry a coefficient. This allows us to multiply states by a scalar, and so to construct sums."
]
},
{
Expand Down Expand Up @@ -1411,12 +1411,13 @@
"These composite `OperatorBase`s are how we construct increasingly complex and rich computation out of `PrimitiveOp` and `StateFn` building blocks.\n",
"\n",
"Every `ListOp` has four properties:\n",
"\n",
"* `oplist` - The list of `OperatorBase`s which may represent terms, factors, etc.\n",
"* `combo_fn` - The function taking a list of complex numbers to an output value which defines how to combine the outputs of the `oplist` items. For broadcasting simplicity, this function is defined over NumPy arrays.\n",
"* `coeff` - A coefficient multiplying the primitive. Note that `coeff` can be int, float, complex or a free `Parameter` object (from `qiskit.circuit` in Terra) to be bound later using `my_op.bind_parameters`.\n",
"* `abelian` - Indicates whether the Operators in `oplist` are known to mutually commute (usually set after being converted by the `AbelianGrouper` converter).\n",
"\n",
"Note that `ListOp` supports typical iteration overloads, so you can use indexing like `my_op[4]` to access the `OperatorBase`s in `oplist`."
"Note that `ListOp` supports typical sequence overloads, so you can use indexing like `my_op[4]` to access the `OperatorBase`s in `oplist`."
]
},
{
Expand Down Expand Up @@ -2060,7 +2061,7 @@
"source": [
"### Executing `CircuitStateFn`s with the `CircuitSampler`\n",
"\n",
"The `CircuitSampler` traverses an Operator and converts any `CircuitStateFns` into approximations of the resulting state function by a `DictStateFn` or `VectorStateFn` using a quantum backend. Note that in order to approximate the value of the `CircuitStateFn`, it must 1) send the state function through a depolarizing channel, which will destroy all phase information and 2) replace the sampled frequencies with **square roots** of the frequency, rather than the raw probability of sampling (which would be the equivalent of sampling the **square** of the state function, per the Born rule.)"
"The `CircuitSampler` traverses an Operator and converts any `CircuitStateFn`s into approximations of the resulting state function by a `DictStateFn` or `VectorStateFn` using a quantum backend. Note that in order to approximate the value of the `CircuitStateFn`, it must 1) send the state function through a depolarizing channel, which will destroy all phase information and 2) replace the sampled frequencies with **square roots** of the frequency, rather than the raw probability of sampling (which would be the equivalent of sampling the **square** of the state function, per the Born rule)."
]
},
{
Expand Down