Skip to content

Commit

Permalink
corrected (#2637)
Browse files Browse the repository at this point in the history
  • Loading branch information
purva-thakre authored Jan 15, 2025
1 parent 33da67f commit 93e6ec3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/source/guide/pec-1-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ We now show how to use PEC to reduce this error.

+++

## Appling probabilistic error cancellation (PEC)
## Applying probabilistic error cancellation (PEC)

+++

Expand Down
2 changes: 1 addition & 1 deletion docs/source/guide/pec-3-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ assert depolarizing_h_rep == h_rep

It is possible to define a qubit-independent {class}`.OperationRepresentation` by setting the option `is_qubit_dependent` to `False`.

In this case, a signle {class}`.OperationRepresentation` representing a gate acting on some arbitrary qubits can be used to mitigate
In this case, a single {class}`.OperationRepresentation` representing a gate acting on some arbitrary qubits can be used to mitigate
the same gate even if acting on different qubits.

```{code-cell} ipython3
Expand Down
10 changes: 5 additions & 5 deletions docs/source/guide/pec-4-low-level.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ executor = mitiq.Executor(batched_execute, max_batch_size=100)
We execute all the auxiliary circuits generated in the previous section to obtain a list of noisy expectation values.

```{code-cell} ipython3
noisy_expecation_values = executor.evaluate(
noisy_expectation_values = executor.evaluate(
sampled_circuits,
force_run_all=False, # Set True if shot noise is present in quantum results.
)
Expand All @@ -190,15 +190,15 @@ only once by setting `force_run_all=False`.
independence of the quantum results.*

```{code-cell} ipython3
print(f"{len(noisy_expecation_values)} noisy expectation values efficiently evaluated by executing only {len(executor.quantum_results)} unique circuits.")
print(f"{len(noisy_expectation_values)} noisy expectation values efficiently evaluated by executing only {len(executor.quantum_results)} unique circuits.")
```

Equivalently, but less efficiently, we could have done as follows:

```{code-cell} ipython3
noisy_expecation_values_direct = batched_execute(sampled_circuits)
noisy_expectation_values_direct = batched_execute(sampled_circuits)
assert noisy_expecation_values_direct == noisy_expecation_values
assert noisy_expectation_values_direct == noisy_expectation_values
```

### Estimate the ideal expectation value from the noisy results
Expand All @@ -212,7 +212,7 @@ the noisy auxiliary expectation values, after scaling them by the corresponding
```{code-cell} ipython3
# Scale noisy results by one-norm coefficient and by sampled signs
unbiased_samples = [
one_norm * value * sign for value, sign in zip(noisy_expecation_values, sampled_signs)
one_norm * value * sign for value, sign in zip(noisy_expectation_values, sampled_signs)
]
# Estimate ideal expectation value
Expand Down

0 comments on commit 93e6ec3

Please sign in to comment.