-
Notifications
You must be signed in to change notification settings - Fork 5
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
f6d695f
commit d63e13e
Showing
4 changed files
with
52 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
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
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,21 @@ | ||
OPENQASM 3.0; | ||
|
||
|
||
gate phase(lambda) q { | ||
U(0, 0, lambda) q; | ||
} | ||
|
||
qubit a; | ||
|
||
array[qubit, 16] aarray; | ||
|
||
input array[angle, 16] aa; | ||
|
||
|
||
phase(aa[0]) a; | ||
|
||
phase(aa[0]) aarray; | ||
|
||
angle assign = aa[0]; | ||
|
||
phase(assign) a; |
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,26 @@ | ||
OPENQASM 3; | ||
|
||
gate rz(theta) q {} | ||
|
||
qubit $0; | ||
|
||
input angle angle_p; | ||
input float[64] float_p; | ||
|
||
input array[angle, 20000] array_angle_p; | ||
input array[float[64], 20000] array_float_p; | ||
|
||
// Access value directly | ||
rz(angle_p) $0; | ||
rz(float_p) $0; | ||
|
||
// Access value through array reference | ||
rz(array_angle_p[0]) $0; | ||
rz(array_float_p[0]) $0; | ||
|
||
// Access value through intermediate assignment | ||
float[64] intermediate_angle = array_angle_p[0]; | ||
float[64] intermediate_float = array_float_p[0]; | ||
|
||
rz(intermediate_angle); | ||
rz(intermediate_float); |