-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
61e6a72
commit cb728e1
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
In this section, advanced programming concepts and implementations in Qadence are examplified. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
This section introduces the `ProjectorBlock` (defined [here](qadence.blocks.primitive.ProjectorBlock)) as an implementation for the the quantum mechanical projection operation. It evaluates to the outer product of a ket and a bra expressed as bitstrings. | ||
|
||
!!! warning | ||
Projectors lead to non-unitary computations. | ||
|
||
|
||
```python exec="on" source="material-block" session="noise" result="json" | ||
from qadence.blocks import block_to_tensor | ||
from qadence.operations import Projector # Projector as an operation. | ||
|
||
|
||
projector_block = Projector(ket="1", bra="1", qubit_support=0) | ||
|
||
# As any block, the matrix representation can be retrieved. | ||
projector_matrix = block_to_tensor(projector_block) | ||
|
||
print(f"projector matrix = {projector_matrix}") # markdown-exec: hide | ||
``` | ||
|
||
Other standard operations can be expressed as projectors: for instance projector controlled-unitary gates or the number operator $N$. |