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/ S3Q/ S4Q/ S5Q/ S6Q/ S7Q/ SNQ/ SOQ/ SPQ/ S;Q/ S<Q/ S=Q/ S>Q/ S?Q/ S@Q/ SAQ/ SBQ// SCQ/SS9/S%9rg)Ra/  
Routines for producing right-angled paths through the Weyl alcove.  Consider a set of native
interactions with an associated minimal covering set of minimum-cost circuit polytopes, as well as a
target coordinate.  The coverage set associates to the target coordinate a circuit type
C = (O1 ... On) consisting of a sequence of native interactions Oj.  A _path_ is a sequence
(I P1 ... Pn) of intermediate Weyl points, where Pj is accessible from P(j-1) by Oj.  A path is said
to be _right-angled_ when at each step one coordinate is fixed (up to possible Weyl reflection) when
expressed in canonical coordinates.

The key inputs to our method are:

+ A family of "b coordinates" which describe the target canonical coordinate.
+ A family of "a coordinates" which describe the source canonical coordinate.
+ A sequence of interaction strengths for which the b-coordinate can be modeled, with one selected
  to be stripped from the sequence ("beta").  The others are bundled as the sum of the
  sequence (s+), its maximum value (s1), and its second maximum value (s2).

Given the b-coordinate and a set of intersection strengths, the procedure for backsolving for the
a-coordinates is then extracted from the monodromy polytope.

NOTE: The constants in this file are auto-generated and are not meant to be edited by hand / read.
    )annotationsN   )ConvexPolytopeDataPolytopeDatamanual_get_vertexpolytope_has_elementc                `    UGt p[        USS/-   5      n[        U5      US   US   U/n/ U QUQ$ )zD
Assembles a coordinate in the system used by `xx_region_polytope`.
r   )sortedsum)target_coordinate	strengthsbetainteraction_coordinates       g/home/james-whalen/.local/lib/python3.13/site-packages/qiskit/synthesis/two_qubit/xx_decompose/paths.pyget_augmented_coordinater   *   sL     !YyAq6)*I!)nimYr]DQ88!788    c                  ^ U  Vs/ s H  o"[         R                  S-  -  PM     n nU Vs/ s H  o"[         R                  -  PM     nn[        X5      nSn[        R                   GHx  m[        TU5      (       d  M  STR                  ;   a  U u  n  nO7STR                  ;   a  U u  penO!STR                  ;   a  U u    peO[        S5      e[        U4S j[        R                   5       S5      n0 nUR                   H  n	U	S   S	:X  a  U	S   S	:X  a  M  U	S	   U	S
   U-  -   U	S   US	   -  -   U	S   US   -  -   U	S   US   -  -   U	S   US
   -  -   U	S   US   -  -   U	S   US   -  -   U	S   US   -  -   n
XR                  U	S   U	S   4U
5      ::  d  M  XU	S   U	S   4'   M     [        [        UR                  5        VVVs/ s H  u  u  poX/PM     snnnS9/S9n  O   Uc  [        S5      e[        U5      u  p[!        XW/SS9 Vs/ s H  o"[         R                  S-  -  PM     sn$ s  snf s  snf s  snnnf s  snf )aJ  
Given a `target_coordinate` and a list of interaction `strengths`, produces a new canonical
coordinate which is one step back along `strengths`.

`target_coordinate` is taken to be in positive canonical coordinates, and the entries of
strengths are taken to be [0, pi], so that (sj / 2, 0, 0) is a positive canonical coordinate.
   NzAF=B1zAF=B2zAF=B3z"Couldn't find a coordinate to fix.c              3  ^   >#    U  H"  oR                   TR                   :X  d  M  Uv   M$     g 7f)N)name).0cppcps     r   	<genexpr>$decomposition_hop.<locals>.<genexpr>O   s%     X@SHHPRPWPWDWSS@s   -	-r   r                     	   
   )inequalitiesconvex_subpolytopesz/Failed to match a constrained_polytope summand.T)reverse)nppir   xx_region_polytoper(   r   r   
ValueErrornextxx_lift_polytoper&   getr   r   itemsr   r   )r   r   xaugmented_coordinatespecialized_polytopeaf_raw_convex_polytopecoefficient_dict
inequalityoffsethlvahalr   s                   @r   decomposition_hopr@   4   s    3DD2CQbeeai2CD$-.IqRUUII.34EQ 44#B(<==bgg(HB1(HA1(HAq"ABB"X,@@XZ^
 -::J!}!jmq&81Q-"$%Q-"6q"99: Q-"6q"99: Q-"6q"99	:
 Q-"6q"99: Q-"6q"99: Q-"6q"99: R.#7#::;  --z!}jm.LfUUCI*Q-A!?@! ;$  ,"?O?U?U?W!X?W!a)?W!X! 
 	W 5Z #JKK34FB%+RRL$%GH%GO%GHHm E.T "Y Is   H.H3H8H?)r   r   r   r   r   r   r
   r   )r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   )r   r   r   r
   r   r   r   r   )r   r   r   r   r   r   r   r   )r   r   r   r   r   r
   r
   r   )r   r
   r
   r   r   r   r   r   )r   r
   r
   r
   r   r   r   r   )r   r   r
   r   r   r   r   r   )r   r   r
   r
   r   r   r   r   )r   r   r
   r
   r   r   r   r
   )r   r   r   r
   r   r
   r   r   )r   r   r
   r   r   r
   r
   r   )r   r   r   r   r   r   r   r   uf   I ∩ A alcove ∩ A unreflected ∩ ah slant ∩ al frustrum ∩ B alcove ∩ B unreflected ∩ AF=B3)r&   
equalitiesr   )r   r
   r
   r
   r   r   r   r   )r
   r   r
   r
   r   r   r   r   )r   r
   r
   r
   r   r   r   r
   ue   I ∩ A alcove ∩ A reflected ∩ ah strength ∩ al frustrum ∩ B alcove ∩ B reflected ∩ AF=B3)r   r
   r   r
   r   r   r   r
   )r   r   r   r
   r   r   r   r
   )r   r
   r   r
   r   r   r   r
   )r   r   r   r
   r   r
   r
   r   uf   I ∩ A alcove ∩ A unreflected ∩ af slant ∩ al frustrum ∩ B alcove ∩ B unreflected ∩ AF=B1)r
   r   r   r
   r   r   r   r
   )r   r
   r   r
   r   r   r   r
   ue   I ∩ A alcove ∩ A reflected ∩ af strength ∩ al frustrum ∩ B alcove ∩ B reflected ∩ AF=B1r'   )r   r   r   r   r   r   r   r   r
   r
   r   )r   r   r   r   r   r   r   r   r   r
   r   )r   r   r   r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   r   r   r   )r   r   r
   r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   r   r   r   )r   r
   r
   r   r   r   r   r   r   r   r   )r   r
   r   r
   r   r   r   r   r   r   r   )r   r
   r
   r
   r   r   r   r   r   r   r   )r   r   r
   r
   r   r   r   r   r   r   r   )r   r   r
   r   r   r   r   r   r
   r
   r   )r   r   r   r   r   r
   r   r   r   r   r   )r   r   r   r   r   r   r
   r   r   r   r   )r   r   r   r   r   r   r   r   r   r   r   )r   r   r   r   r
   r
   r   r   r   r   r   )r   r   r   r   r
   r
   r
   r   r   r   r   )r   r   r   r   r   r
   r
   r   r   r   r   )r   r   r   r   r   r
   r
   r   r   r   r
   )r   r   r   r   r   r   r
   r   r
   r
   r   )r   r   r   r   r   r   r
   r   r
   r   r   )r   r
   r
   r   r   r   r   r   r   r   r   )r   r
   r
   r   r
   r
   r   r   r   r   r
   )r   r   r   r   r
   r
   r   r   r   r   r   )r   r
   r   r   r   r
   r   r   r   r   r   )r   r   r
   r   r
   r   r   r   r   r   r   )r   r   r
   r   r   r
   r   r   r   r   r
   )r   r   r   r   r   r   r
   r   r   r   r   )r   r
   r
   r   r   r   r   r   r   r   r   )r   r
   r
   r   r   r   r   r   r   r   r   )r   r
   r
   r   r   r
   r
   r   r   r   r
   )r   r   r   r   r   r
   r
   r   r   r   r   )r   r
   r   r   r   r   r
   r   r   r   r   )r   r   r
   r   r   r
   r   r   r   r   r   )r   r   r
   r   r   r   r
   r   r   r   r
   )r   r   r   r   r
   r   r   r   r   r   r   )r   r
   r
   r
   r   r   r   r   r   r   r   )r
   r
   r
   r   r   r   r   r   r   r   r   )r
   r   r   r   r   r
   r
   r   r   r   r   )r   r   r   r   r
   r
   r
   r   r   r   r
   )r   r   r   r   r
   r
   r
   r   r   r   r   )r
   r   r
   r
   r   r   r   r   r   r   r   )__doc__
__future__r   numpyr*   	polytopesr   r   r   r   r   r@   r,   r/    r   r   <module>rG      sO  . #  ` `9?ID ")()))(**+)++*+(" f)	
0 	)()))(**,)+,*+(" e)	
0 	)()))(**++)++++(!$ f+	
2 	)()))(**+,)++,+(!$ e+	
Uce L
  32122121133444221344443363334;> ;;fE%	
L 	32122121133444221344443363334;> ;;fE%	
L 	32122121133544221345543363334;> ;;eE%	
L 	32122121133544221345543363334;> ;;eE%	
gY[ xr   