instructions
ZX graph representations of quantum gates and instructions.
GraphRepresentation dataclass
GraphRepresentation(
graph: GraphS = GraphS(),
rec: list[int] = list(),
silent_rec: list[int] = list(),
detectors: list[int] = list(),
observables_dict: dict[int, int] = dict(),
first_vertex: dict[int, int] = dict(),
last_vertex: dict[int, int] = dict(),
channel_probs: list[ndarray] = list(),
correlated_error_probs: list[float] = list(),
num_error_bits: int = 0,
num_correlated_error_bits: int = 0,
track_classical_wires: bool = False,
)
ZX graph built from a stim circuit.
Contains the graph and all auxiliary data needed for sampling.
edge_type property
edge_type
Edge type enum.
observables property
observables: list[int]
Get list of observable vertices sorted by index.
vertex_type property
vertex_type
Vertex type enum.
add_dummy
add_dummy(
b: GraphRepresentation,
qubit: int,
row: float | int | None = None,
) -> int
Add a dummy boundary vertex for a qubit.
Source code in src/tsim/core/instructions.py
81 82 83 84 85 86 87 88 89 | |
add_lane
add_lane(b: GraphRepresentation, qubit: int) -> int
Initialize a qubit lane if it doesn't exist.
Source code in src/tsim/core/instructions.py
92 93 94 95 96 97 98 99 | |
c_nxyz
c_nxyz(b: GraphRepresentation, qubit: int) -> None
Period 3 axis cycling gate, sending -X -> Y -> Z -> -X.
Source code in src/tsim/core/instructions.py
223 224 225 226 227 | |
c_nzyx
c_nzyx(b: GraphRepresentation, qubit: int) -> None
Period 3 axis cycling gate, sending -Z -> Y -> X -> -Z.
Source code in src/tsim/core/instructions.py
250 251 252 253 254 | |
c_xnyz
c_xnyz(b: GraphRepresentation, qubit: int) -> None
Period 3 axis cycling gate, sending X -> -Y -> Z -> X.
Source code in src/tsim/core/instructions.py
230 231 232 233 | |
c_xynz
c_xynz(b: GraphRepresentation, qubit: int) -> None
Period 3 axis cycling gate, sending X -> Y -> -Z -> X.
Source code in src/tsim/core/instructions.py
236 237 238 239 240 | |
c_xyz
c_xyz(b: GraphRepresentation, qubit: int) -> None
Right handed period 3 axis cycling gate, sending X -> Y -> Z -> X.
Source code in src/tsim/core/instructions.py
216 217 218 219 220 | |
c_znyx
c_znyx(b: GraphRepresentation, qubit: int) -> None
Period 3 axis cycling gate, sending Z -> -Y -> X -> Z.
Source code in src/tsim/core/instructions.py
257 258 259 260 261 | |
c_zynx
c_zynx(b: GraphRepresentation, qubit: int) -> None
Period 3 axis cycling gate, sending Z -> Y -> -X -> Z.
Source code in src/tsim/core/instructions.py
264 265 266 267 268 | |
c_zyx
c_zyx(b: GraphRepresentation, qubit: int) -> None
Left handed period 3 axis cycling gate, sending Z -> Y -> X -> Z.
Source code in src/tsim/core/instructions.py
243 244 245 246 247 | |
cnot
cnot(
b: GraphRepresentation,
control: int,
target: int,
classically_controlled: list[bool] | None = None,
) -> None
Apply CNOT (controlled-X) gate.
Source code in src/tsim/core/instructions.py
419 420 421 422 423 424 425 426 | |
correlated_error
correlated_error(
b: GraphRepresentation,
qubits: list[int],
types: list[Literal["X", "Y", "Z"]],
p: float,
) -> None
Add a correlated error term affecting multiple qubits with given Pauli types.
Source code in src/tsim/core/instructions.py
796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 | |
cxswap
cxswap(
b: GraphRepresentation, qubit1: int, qubit2: int
) -> None
Apply CX then SWAP.
Source code in src/tsim/core/instructions.py
465 466 467 468 | |
cy
cy(
b: GraphRepresentation,
control: int,
target: int,
classically_controlled: list[bool] | None = None,
) -> None
Apply controlled-Y gate.
Source code in src/tsim/core/instructions.py
429 430 431 432 433 434 435 436 437 438 | |
cz
cz(
b: GraphRepresentation,
control: int,
target: int,
classically_controlled: list[bool] | None = None,
) -> None
Apply controlled-Z gate.
Source code in src/tsim/core/instructions.py
441 442 443 444 445 446 447 448 | |
czswap
czswap(
b: GraphRepresentation, qubit1: int, qubit2: int
) -> None
Apply CZ then SWAP.
Source code in src/tsim/core/instructions.py
471 472 473 474 | |
depolarize1
depolarize1(
b: GraphRepresentation, qubit: int, p: float
) -> None
Apply single-qubit depolarizing channel with total error probability p.
Source code in src/tsim/core/instructions.py
674 675 676 | |
depolarize2
depolarize2(
b: GraphRepresentation,
qubit_i: int,
qubit_j: int,
p: float,
) -> None
Apply two-qubit depolarizing channel with total error probability p.
Source code in src/tsim/core/instructions.py
679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 | |
detector
detector(
b: GraphRepresentation, rec: list[int], *args
) -> None
Add detector annotation that XORs the given measurement record bits.
Source code in src/tsim/core/instructions.py
1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 | |
ensure_lane
ensure_lane(b: GraphRepresentation, qubit: int) -> None
Ensure qubit lane exists.
Source code in src/tsim/core/instructions.py
102 103 104 105 | |
finalize_correlated_error
finalize_correlated_error(b: GraphRepresentation) -> None
Finalize the current correlated error channel.
- Rename all "c{i}" phases to "e{num_error_bits + i}" in the graph
- Compute and append the 2^k probability array to channel_probs
- Increment num_error_bits by k
- Reset num_correlated_error_bits to 0 and correlated_error_probs to []
Source code in src/tsim/core/instructions.py
759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 | |
h
h(b: GraphRepresentation, qubit: int) -> None
Apply Hadamard gate.
Source code in src/tsim/core/instructions.py
271 272 273 274 275 276 277 278 279 280 281 282 | |
h_nxy
h_nxy(b: GraphRepresentation, qubit: int) -> None
Apply Hadamard-like gate that sends -X <-> Y, Z -> -Z.
Source code in src/tsim/core/instructions.py
292 293 294 295 | |
h_nxz
h_nxz(b: GraphRepresentation, qubit: int) -> None
Apply Hadamard-like gate that sends -X <-> Z.
Source code in src/tsim/core/instructions.py
298 299 300 301 302 | |
h_nyz
h_nyz(b: GraphRepresentation, qubit: int) -> None
Apply Hadamard-like gate that sends -Y <-> Z, X -> -X.
Source code in src/tsim/core/instructions.py
312 313 314 315 316 | |
h_xy
h_xy(b: GraphRepresentation, qubit: int) -> None
Apply variant of Hadamard gate that swaps the X and Y axes (instead of X and Z).
Source code in src/tsim/core/instructions.py
285 286 287 288 289 | |
h_yz
h_yz(b: GraphRepresentation, qubit: int) -> None
Apply variant of Hadamard gate that swaps the Y and Z axes (instead of X and Z).
Source code in src/tsim/core/instructions.py
305 306 307 308 309 | |
heralded_erase
heralded_erase(
b: GraphRepresentation, qubit: int, p: float
) -> None
Apply heralded erasure channel.
Special case of heralded_pauli_channel_1 with equal probabilities p/4 for each of I, X, Y, Z when the channel fires.
Source code in src/tsim/core/instructions.py
750 751 752 753 754 755 756 | |
heralded_pauli_channel_1
heralded_pauli_channel_1(
b: GraphRepresentation,
qubit: int,
pi: float,
px: float,
py: float,
pz: float,
) -> None
Apply heralded single-qubit Pauli channel.
Records a herald bit into the measurement record. When the channel fires (with total probability pi+px+py+pz), the herald is 1 and one of I/X/Y/Z is applied. When it doesn't fire, the herald is 0 and nothing happens.
Source code in src/tsim/core/instructions.py
726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 | |
i
i(
b: GraphRepresentation, qubit: int, *_args: float
) -> None
Apply identity (advances the row).
Source code in src/tsim/core/instructions.py
181 182 183 184 185 | |
ii
ii(
b: GraphRepresentation,
qubit1: int,
qubit2: int,
*_args: float
) -> None
Apply two-qubit identity (advances the row on both qubits).
Source code in src/tsim/core/instructions.py
188 189 190 191 | |
iswap
iswap(
b: GraphRepresentation, qubit1: int, qubit2: int
) -> None
Swap two qubits and phase the -1 eigenspace of the ZZ observable by i.
Source code in src/tsim/core/instructions.py
489 490 491 492 493 494 | |
iswap_dag
iswap_dag(
b: GraphRepresentation, qubit1: int, qubit2: int
) -> None
Swap two qubits and phase the -1 eigenspace of the ZZ observable by -i.
Source code in src/tsim/core/instructions.py
497 498 499 500 501 502 | |
last_edge
last_edge(b: GraphRepresentation, qubit: int)
Get the last edge for a qubit.
Source code in src/tsim/core/instructions.py
74 75 76 77 78 | |
last_row
last_row(b: GraphRepresentation, qubit: int) -> float
Get the row of the last vertex for a qubit.
Source code in src/tsim/core/instructions.py
69 70 71 | |
m
m(
b: GraphRepresentation,
qubit: int,
p: float = 0,
invert: bool = False,
) -> None
Measure qubit in Z basis with optional bit-flip error probability p.
Source code in src/tsim/core/instructions.py
858 859 860 861 862 863 864 | |
mpad
mpad(
b: GraphRepresentation, value: int, p: float = 0
) -> None
Pad measurement record with a fixed bit value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
b | GraphRepresentation | The graph representation to modify. | required |
value | int | The bit value to record (0 or 1). | required |
p | float | Error probability for the recorded bit. | 0 |
Source code in src/tsim/core/instructions.py
952 953 954 955 956 957 958 959 960 961 962 963 964 965 | |
mpp
mpp(
b: GraphRepresentation,
paulis: list[tuple[Literal["X", "Y", "Z"], int]],
invert: bool = False,
p: float = 0,
) -> None
Measure a single Pauli product.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
b | GraphRepresentation | The graph representation to modify. | required |
paulis | list[tuple[Literal['X', 'Y', 'Z'], int]] | List of (pauli_type, qubit) pairs defining the Pauli product. | required |
invert | bool | Whether to invert the measurement result. | False |
p | float | Measurement flip error probability. | 0 |
Source code in src/tsim/core/instructions.py
867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 | |
mr
mr(
b: GraphRepresentation,
qubit: int,
p: float = 0,
invert: bool = False,
) -> None
Z-basis demolition measurement (optionally noisy).
Projects each target qubit into |0> or |1>, reports its value (false=|0>, true=|1>), then resets to |0>.
Source code in src/tsim/core/instructions.py
968 969 970 971 972 973 974 975 | |
mrx
mrx(
b: GraphRepresentation,
qubit: int,
p: float = 0,
invert: bool = False,
) -> None
X-basis demolition measurement (optionally noisy).
Projects each target qubit into |+> or |->, reports its value (false=|+>, true=|->), then resets to |+>.
Source code in src/tsim/core/instructions.py
978 979 980 981 982 983 984 985 986 987 | |
mry
mry(
b: GraphRepresentation,
qubit: int,
p: float = 0,
invert: bool = False,
) -> None
Y-basis demolition measurement (optionally noisy).
Projects each target qubit into |i> or |-i>, reports its value (false=|i>, true=|-i>), then resets to |i>.
Source code in src/tsim/core/instructions.py
990 991 992 993 994 995 996 997 998 999 | |
mx
mx(
b: GraphRepresentation,
qubit: int,
p: float = 0,
invert: bool = False,
) -> None
Measure qubit in X basis.
Source code in src/tsim/core/instructions.py
1002 1003 1004 1005 1006 | |
mxx
mxx(
b: GraphRepresentation,
q0: int,
q1: int,
p: float = 0,
invert: bool = False,
) -> None
Measure two qubits in XX basis.
Source code in src/tsim/core/instructions.py
1016 1017 1018 1019 1020 | |
my
my(
b: GraphRepresentation,
qubit: int,
p: float = 0,
invert: bool = False,
) -> None
Measure qubit in Y basis.
Source code in src/tsim/core/instructions.py
1009 1010 1011 1012 1013 | |
myy
myy(
b: GraphRepresentation,
q0: int,
q1: int,
p: float = 0,
invert: bool = False,
) -> None
Measure two qubits in YY basis.
Source code in src/tsim/core/instructions.py
1023 1024 1025 1026 1027 | |
mzz
mzz(
b: GraphRepresentation,
q0: int,
q1: int,
p: float = 0,
invert: bool = False,
) -> None
Measure two qubits in ZZ basis.
Source code in src/tsim/core/instructions.py
1030 1031 1032 1033 1034 | |
observable_include
observable_include(
b: GraphRepresentation, rec: list[int], idx: int
) -> None
Add observable annotation that XORs the given measurement record bits.
Source code in src/tsim/core/instructions.py
1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 | |
pauli_channel_1
pauli_channel_1(
b: GraphRepresentation,
qubit: int,
px: float,
py: float,
pz: float,
) -> None
Apply single-qubit Pauli channel with given X, Y, Z error probabilities.
Source code in src/tsim/core/instructions.py
631 632 633 634 635 636 637 638 | |
pauli_channel_2
pauli_channel_2(
b: GraphRepresentation,
qubit_i: int,
qubit_j: int,
pix: float,
piy: float,
piz: float,
pxi: float,
pxx: float,
pxy: float,
pxz: float,
pyi: float,
pyx: float,
pyy: float,
pyz: float,
pzi: float,
pzx: float,
pzy: float,
pzz: float,
) -> None
Apply two-qubit Pauli channel with given error probabilities for all 15 Pauli pairs.
Source code in src/tsim/core/instructions.py
641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 | |
r
r(b: GraphRepresentation, qubit: int) -> None
Z-basis reset.
Forces each target qubit into the |0> state by silently measuring it in the Z basis and applying an X gate if it ended up in the |1> state.
Source code in src/tsim/core/instructions.py
1037 1038 1039 1040 1041 1042 1043 | |
r_x
r_x(
b: GraphRepresentation, qubit: int, phase: Fraction
) -> None
Apply R_X rotation gate with given phase (in units of π).
Source code in src/tsim/core/instructions.py
149 150 151 152 | |
r_y
r_y(
b: GraphRepresentation, qubit: int, phase: Fraction
) -> None
Apply R_Y rotation gate with given phase (in units of π).
Source code in src/tsim/core/instructions.py
155 156 157 158 159 | |
r_z
r_z(
b: GraphRepresentation, qubit: int, phase: Fraction
) -> None
Apply R_Z rotation gate with given phase (in units of π).
Source code in src/tsim/core/instructions.py
143 144 145 146 | |
rx
rx(b: GraphRepresentation, qubit: int) -> None
X-basis reset.
Forces each target qubit into the |+> state by silently measuring it in the X basis and applying a Z gate if it ended up in the |-> state.
Source code in src/tsim/core/instructions.py
1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 | |
ry
ry(b: GraphRepresentation, qubit: int) -> None
Y-basis reset.
Forces each target qubit into the |i> state by silently measuring it in the Y basis and applying an X gate if it ended up in the |-i> state.
Source code in src/tsim/core/instructions.py
1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 | |
s
s(b: GraphRepresentation, qubit: int) -> None
Apply S gate (π/2 Z rotation).
Source code in src/tsim/core/instructions.py
319 320 321 | |
s_dag
s_dag(b: GraphRepresentation, qubit: int) -> None
Apply S† gate (-π/2 Z rotation).
Source code in src/tsim/core/instructions.py
358 359 360 | |
spp
spp(
b: GraphRepresentation,
paulis: list[tuple[Literal["X", "Y", "Z"], int]],
dagger: bool = False,
) -> None
Phase the -1 eigenspace of a Pauli product by i (or -i if dagger).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
b | GraphRepresentation | The graph representation to modify. | required |
paulis | list[tuple[Literal['X', 'Y', 'Z'], int]] | List of (pauli_type, qubit) pairs defining the Pauli product. | required |
dagger | bool | If True, phase by -i instead of i. | False |
Source code in src/tsim/core/instructions.py
907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 | |
sqrt_x
sqrt_x(b: GraphRepresentation, qubit: int) -> None
Apply √X gate (π/2 X rotation).
Source code in src/tsim/core/instructions.py
324 325 326 | |
sqrt_x_dag
sqrt_x_dag(b: GraphRepresentation, qubit: int) -> None
Apply √X† gate (-π/2 X rotation).
Source code in src/tsim/core/instructions.py
329 330 331 | |
sqrt_xx
sqrt_xx(
b: GraphRepresentation, qubit1: int, qubit2: int
) -> None
Phases the -1 eigenspace of the XX observable by i.
Source code in src/tsim/core/instructions.py
505 506 507 508 509 | |
sqrt_xx_dag
sqrt_xx_dag(
b: GraphRepresentation, qubit1: int, qubit2: int
) -> None
Phases the -1 eigenspace of the XX observable by -i.
Source code in src/tsim/core/instructions.py
512 513 514 515 516 | |
sqrt_y
sqrt_y(b: GraphRepresentation, qubit: int) -> None
Apply √Y gate (π/2 Y rotation).
Source code in src/tsim/core/instructions.py
334 335 336 337 338 | |
sqrt_y_dag
sqrt_y_dag(b: GraphRepresentation, qubit: int) -> None
Apply √Y† gate (-π/2 Y rotation).
Source code in src/tsim/core/instructions.py
341 342 343 344 345 | |
sqrt_yy
sqrt_yy(
b: GraphRepresentation, qubit1: int, qubit2: int
) -> None
Phases the -1 eigenspace of the YY observable by i.
Source code in src/tsim/core/instructions.py
519 520 521 522 523 524 525 526 527 | |
sqrt_yy_dag
sqrt_yy_dag(
b: GraphRepresentation, qubit1: int, qubit2: int
) -> None
Phases the -1 eigenspace of the YY observable by -i.
Source code in src/tsim/core/instructions.py
530 531 532 533 534 535 536 537 538 | |
sqrt_z
sqrt_z(b: GraphRepresentation, qubit: int) -> None
Apply √Z gate (alias for S gate).
Source code in src/tsim/core/instructions.py
348 349 350 | |
sqrt_z_dag
sqrt_z_dag(b: GraphRepresentation, qubit: int) -> None
Apply √Z† gate (alias for S† gate).
Source code in src/tsim/core/instructions.py
353 354 355 | |
sqrt_zz
sqrt_zz(
b: GraphRepresentation, qubit1: int, qubit2: int
) -> None
Phases the -1 eigenspace of the ZZ observable by i.
Source code in src/tsim/core/instructions.py
541 542 543 544 545 | |
sqrt_zz_dag
sqrt_zz_dag(
b: GraphRepresentation, qubit1: int, qubit2: int
) -> None
Phases the -1 eigenspace of the ZZ observable by -i.
Source code in src/tsim/core/instructions.py
548 549 550 551 552 553 554 | |
swap
swap(
b: GraphRepresentation, qubit1: int, qubit2: int
) -> None
Apply SWAP gate.
Source code in src/tsim/core/instructions.py
451 452 453 454 455 456 457 458 459 460 461 462 | |
swapcx
swapcx(
b: GraphRepresentation, qubit1: int, qubit2: int
) -> None
Apply SWAP then CX.
Source code in src/tsim/core/instructions.py
477 478 479 480 | |
swapcz
swapcz(
b: GraphRepresentation, qubit1: int, qubit2: int
) -> None
Apply SWAP then CZ.
Source code in src/tsim/core/instructions.py
483 484 485 486 | |
t
t(b: GraphRepresentation, qubit: int) -> None
Apply T gate (π/4 Z rotation).
Source code in src/tsim/core/instructions.py
133 134 135 | |
t_dag
t_dag(b: GraphRepresentation, qubit: int) -> None
Apply T† gate (-π/4 Z rotation).
Source code in src/tsim/core/instructions.py
138 139 140 | |
tick
tick(b: GraphRepresentation) -> None
Add a tick to the circuit (align all qubits to same row).
Source code in src/tsim/core/instructions.py
1106 1107 1108 1109 1110 1111 1112 | |
u3
u3(
b: GraphRepresentation,
qubit: int,
theta: Fraction,
phi: Fraction,
lambda_: Fraction,
) -> None
Apply U3 gate: U3(θ,φ,λ) = R_Z(φ)·R_Y(θ)·R_Z(λ).
Source code in src/tsim/core/instructions.py
162 163 164 165 166 167 168 169 170 171 172 173 | |
x
x(b: GraphRepresentation, qubit: int) -> None
Apply Pauli X gate.
Source code in src/tsim/core/instructions.py
194 195 196 | |
x_error
x_error(
b: GraphRepresentation, qubit: int, p: float
) -> None
Apply X error with probability p.
Source code in src/tsim/core/instructions.py
703 704 705 706 707 | |
x_phase
x_phase(
b: GraphRepresentation, qubit: int, phase: Fraction
) -> None
Apply X-axis rotation to qubit. This is equivalent to r_x up to a phase.
Source code in src/tsim/core/instructions.py
113 114 115 116 117 118 119 120 | |
xcx
xcx(
b: GraphRepresentation, control: int, target: int
) -> None
X-controlled X gate. Applies X to target if control is in |-> state.
Source code in src/tsim/core/instructions.py
557 558 559 560 561 | |
xcy
xcy(
b: GraphRepresentation, control: int, target: int
) -> None
X-controlled Y gate. Applies Y to target if control is in |-> state.
Source code in src/tsim/core/instructions.py
564 565 566 567 568 | |
xcz
xcz(
b: GraphRepresentation,
control: int,
target: int,
classically_controlled: list[bool] | None = None,
) -> None
X-controlled Z gate. Applies Z to target if control is in |-> state.
Source code in src/tsim/core/instructions.py
571 572 573 574 575 576 577 578 579 580 581 582 583 | |
y
y(b: GraphRepresentation, qubit: int) -> None
Apply Pauli Y gate.
Source code in src/tsim/core/instructions.py
199 200 201 202 203 | |
y_error
y_error(
b: GraphRepresentation, qubit: int, p: float
) -> None
Apply Y error with probability p.
Source code in src/tsim/core/instructions.py
710 711 712 713 714 715 716 | |
ycx
ycx(
b: GraphRepresentation, control: int, target: int
) -> None
Y-controlled X gate. Applies X to target if control is in |-i> state.
Source code in src/tsim/core/instructions.py
586 587 588 589 590 | |
ycy
ycy(
b: GraphRepresentation, control: int, target: int
) -> None
Y-controlled Y gate. Applies Y to target if control is in |-i> state.
Source code in src/tsim/core/instructions.py
593 594 595 596 597 | |
ycz
ycz(
b: GraphRepresentation,
control: int,
target: int,
classically_controlled: list[bool] | None = None,
) -> None
Y-controlled Z gate. Applies Z to target if control is in |-i> state.
Source code in src/tsim/core/instructions.py
600 601 602 603 604 605 606 607 608 609 610 611 612 | |
z
z(b: GraphRepresentation, qubit: int) -> None
Apply Pauli Z gate.
Source code in src/tsim/core/instructions.py
206 207 208 | |
z_error
z_error(
b: GraphRepresentation, qubit: int, p: float
) -> None
Apply Z error with probability p.
Source code in src/tsim/core/instructions.py
719 720 721 722 723 | |
z_phase
z_phase(
b: GraphRepresentation, qubit: int, phase: Fraction
) -> None
Apply Z-axis phase rotation to qubit. This is equivalent to r_z up to a phase.
Source code in src/tsim/core/instructions.py
123 124 125 126 127 128 129 130 | |