gulps.analysis.region.ReachableRegion¶
- class gulps.analysis.region.ReachableRegion(_bounds)[source]¶
Bases:
objectOne orientation of the local-equivalence classes a gate sentence reaches.
Use
reaches()to test whether the sentence can implement a target. It checks this orientation and its mirror,rho. Coordinates are Weyl(c1, c2, c3)in units of pi. Construct withof().- classmethod of(sentence)¶
The region reached by a sentence of these classes, in any order.
- Parameters:
sentence (Iterable[LocalEquivalenceClass]) – The invariant classes of the two-qubit gates.
- Return type:
- property rho: ReachableRegion¶
The mirror orientation of the same sentence’s reach.
- property vertices: ndarray | None¶
The polytope’s vertices as an
(N, 3)Weyl array, orNoneif empty.
- contains(target)¶
Whether a class lies inside this orientation, by the compiler’s test.
- Parameters:
target (LocalEquivalenceClass | ndarray) – A
LocalEquivalenceClass, one Weyl triple, or an(N, 3)array of Weyl triples.- Returns:
One bool, or a bool array with one entry per row.
- Return type:
- reaches(target)¶
Whether the sentence can implement a target, allowing global phase.
Unlike
contains(), this checks both orientations of the region.- Parameters:
target (LocalEquivalenceClass | ndarray) – A
LocalEquivalenceClass, one Weyl triple, or an(N, 3)array of Weyl triples.- Returns:
One bool, or a bool array with one entry per row.
- Return type: