unitary
Gate
Bases: Unitary, ABC
Source code in opensquirrel/ir/unitary.py
compare_gates
Checks if two gates are equivalent up to a global phase.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gate_1
|
Gate
|
The first gate to compare. |
required |
gate_2
|
Gate
|
The second gate to compare. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the two gates are equivalent up to a global phase, False otherwise. |