?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstu v w x y z { | } ~                         Safe-Inferred?A step computation can be run for a specified number of steps, B stopped, continued, and interleaved. Such a computation produces  "ticks": at user-defined intervals, which must be consumed by the . environment for the computation to continue.  Produce a "tick", then resume the  computation. Terminate with a result. Issue a single tick. 'Run the step computation for one step. Fast-forward a computation by n steps. This is essentially  equivalent to doing n  operations. /Check whether a step computation is completed. 8Retrieve the result of a completed step computation (or   if it is incomplete). 'Run a subsidiary computation for up to n steps, translated into 5 an equal number of steps of the parent computation. -Run a subtask, speeding it up by a factor of n ==|**.%|== 1. Every 1 tick of ' the calling task corresponds to up to n ticks of the subtask. 8Run two step computations in parallel, until one branch ? terminates. Tick allocation is associative: each tick of the C parent function translates into one tick for each subcomputation. C Therefore, when running, e.g., three subcomputations in parallel, @ they will each receive an approximately equal number of ticks. :Wrap a step computation to return the number of steps, in  addition to the result. *Run a step computation until it finishes. >Run a step computation until it finishes, and also return the  number of steps it took. #Run a step computation for at most n steps. Do nothing, forever. ARun two step computations in parallel. The first one to complete ( becomes the result of the computation. =Run two step computations in parallel. If either computation  returns  , return  . Otherwise, return the pair of  results. @Run a list of step computations in parallel. If any computation  returns  , return  . Otherwise, return the list of  results.     NoneA axis is either I, H, or SH. ;A type class for things that can be exactly converted to a 7 Clifford operator. One particular instance of this is , so / that Clifford operators can be denoted, e.g.,   to_clifford "-iX" 5The valid characters for such string conversions are " XYZHSEIWi-". 3Convert any suitable thing to a Clifford operator. 5A type representing single-qubit Clifford operators.  The Pauli X-gate as a Clifford operator.  The Pauli Y-gate as a Clifford operator.  The Pauli Z-gate as a Clifford operator. *The Hadamard gate as a Clifford operator. The Clifford operator S. The Clifford operator SH. The Clifford operator E = HS[sup 3]uni__969__[sup 3]. This operator is ' uniquely determined by the properties E uni__179__ = I,  EXE==|*~!%|==uni__185__ = Y, EYE==|*~!%|==uni__185__ = Z, and EZE==|*~!%|==uni__185__ = X. [ image E.png] !(The Clifford operator uni__969__ = [exp i uni__960__/4]. "Given a Clifford operator U , return (a, b, c, d ) such that  U = E[sup a]X[sup b]S[sup c]uni__969__[sup d],  a ==|*+!?|== {0, 1, 2}, b ==|*+!?|== {0, 1}, c$ ==|*+!?|== {0, ==|*?~.|==, 3}, and d ==|*+!?|== {0, ==|*?~.|==,  7}. Here, E = HS[sup 3]uni__969__[sup 3] . Note that E, X, S, and uni__969__ have order D 3, 2, 4, and 8, respectively. Moreover, each Clifford operator can # be uniquely represented as above. #Given a Clifford operator U , return (K, b, c, d ) such that  U = KX[sup b]S[sup c]uni__969__[sup d],  K ==|*+!?|== {I, H, SH}, b ==|*+!?|== {0, 1}, c$ ==|*+!?|== {0, ==|*?~.|==, 3}, and d ==|*+!?|== {0, ==|*?~.|==,  7}. $ The identity Clifford operator. %Clifford multiplication. &Clifford inverse. 'Given a Clifford gate C, return an axis K ==|*+!?|== {I, H, SH}  and a Clifford gate C' such that  CT = KTC'.  c b returns (c', d' ) such that  S[sup c]X[sup b] = X[sup b]S[sup c']uni__969__[sup d'].  b c a returns (a', b', c', d' ) such that  X[sup b]S[sup c]E[sup a] = E[sup a']X[sup b']S[sup c']uni__969__[sup d'].  a b c returns (a', b', c', d' ) such that  (E[sup a]X[sup b]S[sup c])==|*~!%|==uni__185__ = E[sup a']X[sup b']S[sup c']uni__969__[sup d']. tconj2 a b returns (K, c, d ) such that  E[sup a]X[sup b]T = KTX[sup b]S[sup c]uni__969__[sup d].  !"#$%&' !"#$%&' !"#$%&' !"#$%&' Safe-Inferred($We provide a replacement for Haskell's , because the  latter depends on the  class, which limits its  applicability. ()()()() Safe-Inferred7*BA type class for things that can be converted to a real number at  arbitrary precision. ,;A type to represent symbolic expressions for real numbers. Caution: equality + at this type denotes symbolic equality of 8 expressions, not equality of the defined real numbers. -arctan2 x y. .acosh x. /atanh x. 0asinh x. 1cosh x. 2tanh x. 3sinh x. 4acos x. 5atan x. 6asin x. 7cos x. 8cos x. 9sin x. :x[sup y]. ;log x. < ==|*+~.|==x. =[exp x]. >e. ? uni__960__. @1/x. Asignum(x). B|x|. C= =|*+??|==x. Dx / y. Ex * y. Fx  ==|*+??|== y. Gx + y. HKA decimal constant. This has a rational value and a string representation. IAn integer constant. J@It would be useful to have a function for converting a symbolic < real number to a fixed-precision real number with a chosen $ precision, such that the precision e depends on a parameter d:  ; to_fixedprec :: (ToReal r) => Integer -> r -> FixedPrec e  to_fixedprec d x = ... However, since e is a type, d is a term, and Haskell is not 2 dependently typed, this cannot be done directly.  The function J# is the closest thing we have to a  workaround. The call dynamic_fixedprec d f x calls  f(x' ), where x' is the value x converted to d digits of % precision. In other words, we have  1 dynamic_fixedprec d f x = f (to_fixedprec d x), (with the restriction that the precision e cannot occur freely in  the result type of f. KLike J), but take two real number arguments. In " terms of the fictitious function  to_fixedprec , we have: G dynamic_fixedprec2 d f x y = f (to_fixedprec d x) (to_fixedprec d y). Linteger ::= digit digit*. Mfloat ::= digit* "." digit*. LThere must be at least one digit, either before or after the decimal point. Nconst_pi ::= "pi". Oconst_e ::= "e". Pnegative ::= " ==|*+??|==". Qpositive ::= "+". R plus_term ::= "+" exp7. S minus_term ::= " ==|*+??|==" exp7. T times_term ::= "*" exp8. Udiv_term ::= "/" exp8. V power_term ::= exp10 "**" | exp10 "^". W unary_fun ::= unary_op exp10. Xunary_op ::= "abs" | "signum" | ... Y binary_fun ::=  binary_op exp10 exp10. Z binary_op ::= "abs" | "signum" | ... [exp6 ::= (negative | positive)? exp7 (  plus_term |  minus_term )*. ;An expression whose top-level operator has precedence 6 or * above. The operators of precedence 6 are "+" and " ==|*+??|==". \exp7 ::= exp8 (  times_term | div_term )*. ;An expression whose top-level operator has precedence 7 or * above. The operators of precedence 6 are "*" and "/". ]exp8 ::= (  power_term )* exp10 ;An expression whose top-level operator has precedence 8 or * above. The operators of precedence 6 are "**" and "^". ^exp10 ::=  parenthesized | const_pi | const_e | integer | float |  unary_fun |  binary_fun. <An expression whose top-level operator has precedence 10 or > above. Such expressions are constants, applications of unary  operators (except unary " ==|*+??|==" and "+"), and parenthesized  expressions. _ parenthesized ::= "(" exp6 ")". ` expression ::= exp6  end-of-line.  This is a top-level expression. aBParse a symbolic real number expression. Typical strings that can  be parsed are "1.0", "pi/128", " (1+sin(pi/3))^2" , etc. If ) the expression cannot be parsed, return . E*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`a     8*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`a8,IHGFEDCBA@?>=<;:9876543210/.-*+JKLMNOPQRSTUVWXYZ[\]^_`a'*+,IHGFEDCBA@?>=<;:9876543210/.-JKLMNOPQRSTUVWXYZ[\]^_`a     NoneNb*A type class for things that have parity. c Return the parity of something. dOA type class for things that can be exactly converted to UNI__8474__[uni__969__]. eConversion to p. f6A type class for things from which a common power of 1/==|*+~.|==2 (a D least denominator exponent) can be factored out. Typical instances  are , x), as well as tuples, lists, vectors, and  matrices thereof. g)Calculate the least denominator exponent k of a . Returns  the smallest k==|**.%|==0 such that a = b/==|*+~.|==2[sup k] for some  integral b. h Factor out a k th power of 1/==|*+~.|==2 from a. In other words,  calculate a==|*+~.|==2[sup k]. i9A type class for rings that have a distinguished subring "of  integers". A typical instance is a =  , which has b =   as its ring of integers. j<The embedding of the ring of integers into the larger ring. kThe inverse of j. Throws an error if the given 1 element is not actually an integer in the ring. l#A type class for rings that have a "real" component. A typical  instance is a = x with b = . mTake the real part. nA type class relating "rational" types to their dyadic  counterparts. o Convert a "rational" value to a "dyadic" value, if the 0 denominator is a power of 2. Otherwise, return . p The field UNI__8474__[uni__969__] of cyclotomic rationals of degree 8. qThe ring [bold D] [uni__969__]. Here [bold D]=UNI__8484__[uni__189__] is the ring of dyadic  fractions. In fact, [bold D] [uni__969__]" is isomorphic to the ring [bold D][==|*+~.|==2,  i], but they have different  instances. rThe ring UNI__8484__[uni__969__] of cyclotomic integers of degree 8. Such rings D were first studied by Kummer around 1840, and used in his proof of  special cases of Fermat's Last Theorem. See also:   Rhttp://fermatslasttheorem.blogspot.com/2006/05/basic-properties-of-cyclotomic.html   Ghttp://fermatslasttheorem.blogspot.com/2006/02/cyclotomic-integers.html  Harold M. Edwards, "Fermat's Last Theorem: A Genetic ( Introduction to Algebraic Number Theory". s The ring R [uni__969__], where R/ is any ring, and uni__969__ = [exp iuni__960__/4] is an  8th root of unity. The value s a b c d represents  auni__969__[sup 3]+buni__969__[sup 2]+c uni__969__+d. u1Single precision complex floating point numbers. v1Double precision complex floating point numbers. w#The field UNI__8474__[==|*+~.|==2, i]. xThe ring [bold D][==|*+~.|==2, i] = UNI__8484__[1/ ==|*+~.|==2, i]. yThe ring UNI__8474__[i] of Gaussian rationals. zThe ring [bold D][i] = UNI__8484__[uni__189__, i] of Gaussian dyadic fractions. {The ring UNI__8484__[i] of Gaussian integers. | The ring R[i], where R# is any ring. The reason we do not  use the  a- type from the standard Haskell libraries is 3 that it assumes too much, for example, it assumes a is a member  of the . class. Also, this allows us to define a more  sensible  instance. ~!The field UNI__8474__[==|*+~.|==2]. The ring [bold D] [==|*+~.|==2] = UNI__8484__[1/ ==|*+~.|==2].  The ring UNI__8484__[==|*+~.|==2].  The ring R [==|*+~.|==2], where R is any ring. The value  a  b represents a + b ==|*+~.|==2. ?We define our own variant of the rational numbers, which is an  identical copy of the type  from the standard Haskell - library, except that it has a more sensible  instance. >A dyadic fraction is a rational number whose denominator is a 6 power of 2. We denote the dyadic fractions by [bold D] = UNI__8484__[uni__189__]. *We internally represent a dyadic fraction a/2[sup n] as a pair  (a,n;). Note that this representation is not unique. When it is E necessary to choose a canonical representative, we choose the least  possible n ==|**.%|==0. 7The ring UNI__8484__uni__8322__ of integers modulo 2. The  and $ functions provided by the standard C Haskell libraries are predicated on many unnecessary assumptions. * This type class provides an alternative. Minimal complete definition:  or . Compute the floor of x, i.e., the greatest integer n such  that n ==|**.$|== x. Compute the ceiling of x, i.e., the least integer n such  that x ==|**.$|== n. A (number-theoretic) norm on a ring R is a function N : R " ==|*%-$|== UNI__8484__ such that N(rs) = N(r)N(s ), for all r, s ==|*+!?|== R.  The norm also satisfies N(r ) = 0 iff r = 0, and N(r) = ==|!++|==1  iff r is a unit of the ring. @A type class for rings with a ==|*+~.|==2-conjugation, i.e., an = automorphism mapping ==|*+~.|==2 to ==|*+??|====|*+~.|==2. ?When instances of this type class are vectors or matrices, the  ==|*+~.|==2-conjugation does not) exchange the roles of rows and columns. MFor rings that have no ==|*+~.|==2, the conjugation can be defined to be the  identity function. Compute the adjoint, mapping a + b==|*+~.|==2 to a ==|*+??|==b ==|*+~.|==2. :A type class for rings with complex conjugation, i.e., an  automorphism mapping i to ==|*+??|==i. ?When instances of this type class are vectors or matrices, the D conjugation also exchanges the roles of rows and columns (in other  words, it is the adjoint). BFor rings that are not complex, the conjugation can be defined to  be the identity function. 3Compute the adjoint (complex conjugate transpose). 5A type class for rings that contain a square root of i, or - equivalently, a fourth root of ==|*+??|==1. The square root of i. 9A type class for rings that contain a square root of -1. The complex unit. %A type class for rings that contain 1/ ==|*+~.|==2. The square root of uni__189__. 1A type class for rings that contain ==|*+~.|==2. The square root of 2. 0A type class for rings that contain uni__189__. Minimal complete definition: . The default definition of   uses the expression a*half^n. However, this can give B potentially bad round-off errors for fixed-precision types where  the expression half^n+ can underflow. For such rings, one should 3 provide a custom definition, for example by using a/2^n instead. The value uni__189__. 8The unique ring homomorphism from UNI__8484__[uni__189__] to any . This & exists because UNI__8484__[uni__189__] is the free . &A type class to denote rings. We make  a synonym of  Haskell's 3 type class, so that we can use the usual notation  , , 6 for the ring operations. This is not a perfect fit,  because Haskell's - class also contains two non-ring operations   and 0. By convention, for rings where these notions  don'5t make sense (or are inconvenient to define), we set  x  = x and  x = 1. Given a dyadic fraction r , return (a,n ) such that r =  a/2[sup n], where n,==|**.%|==0 is chosen as small as possible. Given a dyadic fraction r and an integer k==|**.%|==0, such that a =  r2[sup k] is an integer, return a. If a is not an integer,  the behavior is undefined. ;An auxiliary function for printing rational numbers, using 6 correct precedences, and omitting denominators of 1. Conversion from  to any   type. 9The unique ring homomorphism from UNI__8484__[==|*+~.|==2] to any ring containing 9 ==|*+~.|==2. This exists because UNI__8484__[==|*+~.|==2] is the free such ring. =Return a square root of an element of UNI__8484__[==|*+~.|==2], if such a square  root exists, or else . )The unique ring homomorphism from [bold D] [==|*+~.|==2] to any ring containing  1/(==|*+~.|==2. This exists because [bold D] [==|*+~.|==2] = UNI__8484__[1/ ==|*+~.|==2] is the free such ring. 9The unique ring homomorphism from UNI__8474__[==|*+~.|==2] to any ring containing R the rational numbers and ==|*+~.|==2. This exists because UNI__8474__[==|*+~.|==2] is the free  such ring. .The unique ring homomorphism from UNI__8484__[i] to any ring containing  i". This exists because UNI__8484__[i] is the free such ring. )The unique ring homomorphism from [bold D][i] to any ring containing  uni__189__ and i. This exists because [bold D][i] is the free such ring. .The unique ring homomorphism from UNI__8474__[i] to any ring containing  the rational numbers and i". This exists because UNI__8474__[i] is the  free such ring. )The unique ring homomorphism from [bold D][==|*+~.|==2, i] to any ring  containing 1/==|*+~.|==2 and i. This exists because [bold D][==|*+~.|==2, i] =  UNI__8484__[1/ ==|*+~.|==2, i] is the free such ring. ;The unique ring homomorphism from UNI__8474__[==|*+~.|==2, i] to any ring 3 containing the rational numbers, ==|*+~.|==2, and i. This exists because  UNI__8474__[==|*+~.|==2, i] is the free such ring. An inverse to the embedding R ==|*^!$|== R [uni__969__] : return the "real  rational" part.  In other words, map auni__969__[sup 3]+buni__969__[sup 2]+c uni__969__+d to d. 8The unique ring homomorphism from UNI__8484__[uni__969__] to any ring containing 7 uni__969__. This exists because UNI__8484__[uni__969__] is the free such ring. 0Inverse of the embedding UNI__8484__[==|*+~.|==2]" ==|*%-$|== UNI__8484__[uni__969__]#. Note that UNI__8484__[==|*+~.|==2] = UNI__8484__[uni__969__] ==|*+$%|== F UNI__8477__. This function takes an element of UNI__8484__[uni__969__] that is real, and 5 converts it to an element of UNI__8484__[==|*+~.|==2]". It throws an error if the input  is not real. )The unique ring homomorphism from [bold D] [uni__969__] to any ring containing  1/==|*+~.|==2 and i. This exists because [bold D] [uni__969__] is the free such ring. 8The unique ring homomorphism from UNI__8474__[uni__969__] to any ring containing the $ rational numbers, ==|*+~.|==2, and i,. This exists because UNI__8474__[uni__969__] is the free  such ring.  Convert a "rational" value to a "dyadic" value, if the 9 denominator is a power of 2. Otherwise, throw an error. 8Calculate and factor out the least denominator exponent k of  a . Return (b,k ), where a = b/(==|*+~.|==2)[sup k] and k ==|**.%|==0. Generic !3-like method that factors out a common denominator  exponent. %Return the position of the rightmost "1" bit of an Integer, or  -1 if none. Do this in time O(n log n ), where n is the size  of the integer (in digits). If n is of the form 2[sup k] , return k. Otherwise, return  . (Return 1 + the position of the leftmost "1" bit of a  non-negative ". Do this in time O(n log n ), where n ) is the size of the integer (in digits). For n6 ==|**.%|== 0, return the floor of the square root of n . This is A done using integer arithmetic, so there are no rounding errors. bcdefghijklmnopqrstuvwxyz{|}~#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Wbcdefghijklmnopqrstuvwxyz{|}~W~|}{zyxwvustrqpnolmijkfghdebcbcdefghijklmnopqrstuvwxyz{|}~#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~NoneS@A convenient abbreviation for the type of 3==|?!%|==3-matrices. @A convenient abbreviation for the type of 2==|?!%|==2-matrices. An m ==|?!%|==n-matrix is a list of n columns, each of which is a  list of m4 scalars. The type of square matrices of any fixed ! dimension is an instance of the  class, and therefore the  usual symbols, such as "" and "" can be used on 5 them. However, the non-square matrices, the symbols "" and  "" must be used. Vector n a is the type of lists of length n with elements  from a. We call this a "vector"! rather than a tuple or list for A two reasons: the vectors are homogeneous (all elements have the E same type), and they are strict: if any one component is undefined,  the whole vector is undefined. .Multiplication of type-level natural numbers. (Addition of type-level natural numbers. BA type class for the natural numbers. The members are exactly the  type-level natural numbers. 9Return a term-level natural number corresponding to this  type-level natural number. =Return a term-level integer corresponding to this type-level B natural number. The argument is just a dummy argument and is not  evaluated. 6A data type for the natural numbers. Specifically, if n is a ! type-level natural number, then   NNat n 7is a singleton type containing only the natural number n. >The 10th successor of a natural number type. For example, the  natural number 18 as a type is  Ten_and Eight !The natural number 10 as a type.  The natural number 9 as a type.  The natural number 8 as a type.  The natural number 7 as a type.  The natural number 6 as a type.  The natural number 5 as a type.  The natural number 4 as a type.  The natural number 3 as a type.  The natural number 2 as a type.  The natural number 1 as a type. (Type-level representation of successor. #Type-level representation of zero.  Convert an  to an ".  Construct a vector of length 1. 9Return the length of a vector. Since this information is C contained in the type, the vector argument is never evaluated and & can be a dummy (undefined) argument. 1Convert a fixed-length list to an ordinary list. Zip two equal length lists. )Map a function over a fixed-length list. %Create the vector (0, 1, ==|*?~.|==, n-1). Create the vector (f(0), f(1), ==|*?~.|==, f(n-1)). >Construct a vector from a list. Note: since the length of the @ vector is a type-level integer, it cannot be inferred from the D length of the input list; instead, it must be specified explicitly A in the type. It is an error to apply this function to a list of  the wrong length.  Return the i2th element of the vector. Counting starts from 0. / Throws an error if the index is out of range. =Return a fixed-length list consisting of a repetition of the  given element. Unlike #, no count is needed, because this A information is already contained in the type. However, the type / must of course be inferable from the context. ,Turn a list of columns into a list of rows. +Left strict fold over a fixed-length list. %Right fold over a fixed-length list. BReturn the tail of a fixed-length list. Note that the type system  ensures that this never fails. BReturn the head of a fixed-length list. Note that the type system  ensures that this never fails. Append two fixed-length lists.  Version of  for fixed-length lists. +Decompose a matrix into a list of columns. Return the size (m, n) of a matrix, where m is the number  of rows, and n2 is the number of columns. Since this information D is contained in the type, the matrix argument is not evaluated and & can be a dummy (undefined) argument.  Addition of m ==|?!%|==n+-matrices. We use a special symbol because  m ==|?!%|==n#-matrices do not form a ring; only n ==|?!%|==n-matrices form a ' ring (in which case the normal symbol "" also works). Subtraction of m ==|?!%|==n+-matrices. We use a special symbol because  m ==|?!%|==n#-matrices do not form a ring; only n ==|?!%|==n-matrices form a ' ring (in which case the normal symbol "" also works). 2Map some function over every element of a matrix. Create the matrix whose i,j -entry is (i,j). Here i and  j1 are 0-based, i.e., the top left entry is (0,0). Create the matrix whose i,j -entry is f i j. Here i and  j* are 0-based, i.e., the top left entry is f 0 0. "Multiplication of a scalar and an m ==|?!%|==n -matrix. Division of an m ==|?!%|==n-matrix by a scalar. Multiplication of m ==|?!%|==n#-matrices. We use a special symbol  because m ==|?!%|==n#-matrices do not form a ring; only n ==|?!%|==n -matrices . form a ring (in which case the normal symbol "" also works). ,Return the 0 matrix of the given dimension. Take the transpose of an m ==|?!%|==n -matrix. Take the adjoint of an m ==|?!%|==n-matrix. Unlike , this can be ! applied to non-square matrices. Return the element in the i th row and jth column of the E matrix. Counting of rows and columns starts from 0. Throws an error  if the index is out of range. @Return a list of all the entries of a matrix, in some fixed but  unspecified order.  Version of  for matrices. %Return the trace of a square matrix. 4Return the square of the Hilbert-Schmidt norm of an  m ==|?!%|==n-matrix, defined by ==|*?!$|==M==|*?!$|==uni__178__ = tr M[sup ==|*??$|==]M. Stack matrices vertically. Stack matrices horizontally. ARepeat a matrix vertically, according to some vector of scalars. -Vertically concatenate a vector of matrices. CRepeat a matrix horizontally, according to some vector of scalars. /Horizontally concatenate a vector of matrices. "Kronecker tensor of two matrices. Form a diagonal block matrix. Form a controlled gate. ?A convenience constructor for matrices: turn a list of columns  into a matrix. BNote: since the dimensions of the matrix are type-level integers, D they cannot be inferred from the dimensions of the input; instead, B they must be specified explicitly in the type. It is an error to 7 apply this function to a list of the wrong dimension. AA convenience constructor for matrices: turn a list of rows into  a matrix. BNote: since the dimensions of the matrix are type-level integers, D they cannot be inferred from the dimensions of the input; instead, B they must be specified explicitly in the type. It is an error to 7 apply this function to a list of the wrong dimension. A synonym for . &Turn a matrix into a list of columns. #Turn a matrix into a list of rows. IA convenience constructor for 2==|?!%|==2-matrices. The arguments are by  rows. JA convenience destructor for 2==|?!%|==2-matrices. The result is by rows.  IA convenience constructor for 3==|?!%|==3-matrices. The arguments are by  rows.  IA convenience constructor for 4==|?!%|==4-matrices. The arguments are by  rows.  <A convenience constructor for 3-dimensional column vectors.  @A convenience destructor for 3-dimensional column vectors. This  is the inverse of  .  EA convenience constructor for turning a vector into a column matrix. Controlled-not gate.  Swap gate. A z-rotation gate, R[sub z](uni__952__) = [exp ==|*+??|==i uni__952__Z/2]. n     X     X     g     None,ASymbolic representation of one- and two-level operators, with an  alternate set of generators. Note: when we use a list of  operators to express a > sequence of operators, the operators are meant to be applied A right-to-left, i.e., as in the mathematical notation for matrix = multiplication. This is the opposite of the quantum circuit  notation. (uni__969__[sub i])[super m]. W[super m][sub i,j]. (T[super ==|*+??|==m] (iH)T[super m])[sub i,j]. iX[sub i,j]. The  residue type of t" ==|*+!?|== UNI__8484__[uni__969__] is the residue of t[sup ==|*??$|==]t.  It is 0000, 0001, or 1010. >Symbolic representation of one- and two-level operators. Note  that the power k in the  and  constructors can be 8 positive or negative, and should be regarded modulo 8. Note: when we use a list of  operators to express a > sequence of operators, the operators are meant to be applied A right-to-left, i.e., as in the mathematical notation for matrix = multiplication. This is the opposite of the quantum circuit  notation. (uni__969__[sub i])[super k]. (T[sub i,j])[super k]. H[sub i,j]. X[sub i,j]. *An index for a row or column of a matrix.  9A type class for things that have residues. In a typical  instance, a- is a ring whose elements are expressed with " coefficients in UNI__8484__, and b( is a corresponding ring whose elements 5 are expressed with coefficients in UNI__8484__[sub 2]. !!Return the residue of something. " Invert a  operator. #Invert a list of  operators. $5Construct a two-level matrix with the given entries. %3Construct a one-level matrix with the given entry. &=Convert a symbolic one- or two-level operator into a matrix. '>Convert a list of symbolic one- or two-level operators into a B matrix. Note that the operators are to be applied right-to-left, & exactly as in mathematical notation. ( Replace the ith element of a list by x. )"Apply a unary operator to element i of a list. *$Apply a binary operator to elements i and j of a list. +=Split a list into pairs. Return a list of pairs, and a final , element if the length of the list was odd. ,,Given an element of the form uni__969__[sup m] , return m! ==|*+!?|== {0,==|*?~.|==,7}, or   if not of that form. -$Multiply a scalar by uni__969__[sup n]. .Divide an element of r, by ==|*+~.|==2, or throw an error if it is  not divisible. / Apply the X) operator to a 2-dimensional vector over r. 0 Apply the H) operator to a 2-dimensional vector over  r9. This throws an error if the result is not well-defined  over r. 1Apply a  operator to a r-vector, represented as D a list. Throws an error if any operation produces a scalar that is  not in r. 2Apply a list of  operators to a r -vector, D represented as a list. Throws an error if any operation produces a  scalar that is not in r. 3Return the residue's . 4Return the residue's shift. The shift is defined so that:  0001, 1110, 0011 have shift 0,  0010, 1101, 0110 have shift 1, $ 0100, 1011, 1100 have shift 2, and  1000, 0111, 1001 have shift 3. Residues of type  have shift 0. 5Return the residue's  and the shift. 6Given two irreducible residues a and b of the same type, find  an index m such that a + uni__969__[sup m]b = 0000. If no such index  exists, find an index m such that a + uni__969__[sup m]b = 1111. 70Check whether a residue is reducible. A residue r is called  reducible  if it is of the form r = ==|*+~.|==2 ==|*-.!|== r', i.e., r& ==|*+!?|== {0000, 0101, 1010, 1111}. 8>Perform a single row operation as in Lemma 4, applied to rows i  and j. The entries at rows i and j are x and y, ( respectively, with respective residues a and b. A precondition  is that x and y1 are of the same residue type. Returns a list of ? two-level operations that decreases the denominator exponent. 9*Row reduction: Given a unit column vector v , generate a 2 sequence of two-level operators that reduces the i th standard  basis vector e[sub i] to v!. Any rows that are already 0 in 0 both vectors are guaranteed not to be touched. :Input an exact n ==|?!%|==n' unitary operator with coefficients in  [bold D] [uni__969__]1, and output an equivalent sequence of two-level E operators. This is the algorithm from the Giles-Selinger paper. It " has superexponential complexity. Note: the list of  operators will be returned in @ right-to-left order, i.e., as in the mathematical notation for D matrix multiplication. This is the opposite of the quantum circuit  notation. ;BConvert from the alternate generators to the original generators. <Invert a list of # operators, and convert the output  to a list of  operators. =>Perform a single row operation as in Lemma 4, applied to rows i  and j:, using the generators of Section 6. The entries at rows  i and j are x and y), respectively, with respective residues  a and b. A precondition is that x and y are of the same E residue type. Returns a list of two-level operations that decreases  the denominator exponent. >*Row reduction: Given a unit column vector v , generate a 2 sequence of two-level operators that reduces the i th standard  basis vector e[sub i] to v!. Any rows that are already 0 in D both vectors are guaranteed not to be touched, except possibly row  i"+1 may be multiplied by a scalar. ?Input an exact n ==|?!%|==n' unitary operator with coefficients in  [bold D] [uni__969__]1, and output an equivalent sequence of two-level E operators (in the alternative generators, where all but at most one C of the generators has determinant 1). This is the algorithm from > the Giles-Selinger paper, Section 6. It has superexponential  complexity. Note: the list of  operators will be returned in @ right-to-left order, i.e., as in the mathematical notation for D matrix multiplication. This is the opposite of the quantum circuit  notation. 8 !"#$%&'()*+,-./0123456789:;<=>?/ !"#$%&'()*+,-./0123456789:;<=>?/ !"#$%&'()*+,-./0123456789:;<=>?, !"#$%&'()*+,-./0123456789:;<=>?None,@/Syllables is a circuit of the form (uni__949__|T) (HT|SHT)[sup *]. A!A sequence of the form ==|*?~.|==SHT. B!A sequence of the form ==|*?~.|==HT. C The sequence T. DThe empty sequence uni__949__. E6A representation of normal forms, optimized for right  multiplication. GBA type class for all things that a list of gates can be converted D to. For example, a list of gates can be converted to an element of  U(2) or an element of SO(3), using various (exact or 5 approximate) representations of the matrix entries. H.Convert a list of gates to any suitable type. I?A type class for all things that can be exactly converted to a ; list of gates. These are the exact representations of the  single-qubit Clifford+T group. J/Convert any suitable thing to a list of gates. K7An enumeration type to represent symbolic basic gates (X, Y,  Z, H, S, T, W, E). Note: when we use a list of Ks to express a sequence of A operators, the operators are meant to be applied right-to-left, B i.e., as in the mathematical notation for matrix multiplication. 7 This is the opposite of the quantum circuit notation. TInvert a gate list. U*Convert any precise format to any format. V The Pauli X operator. W The Pauli Y operator. X The Pauli Z operator. YThe Hadamard operator. ZThe S operator. [The T operator. \The E operator. ]The W = [exp i uni__960__/4] global phase operator. ^7Convert a symbolic gate to the corresponding operator. _ The Pauli X operator. ` The Pauli Y operator. a The Pauli Z operator. bThe Hadamard operator. c The operator S. d The operator E. eThe T operator. f:Convert a symbolic gate to the corresponding Bloch sphere  operator. gConversion from U(2) to SO(3). h+Convert a Clifford operator to a matrix in SO(3). iConvert a matrix in SO*(3) to a Clifford gate. Throw an error if  the matrix isn' t Clifford. j0Right-multiply the given normal form by a gate. kThe identity as a normal form. l7Multiply two normal forms. The right factor can be any  I. m+Invert a normal form. The input can be any I. n Convert any I list to a E, thereby normalizing it. oInput an exact matrix in SO"(3), and output the corresponding  Clifford+T8 normal form. It is an error if the given matrix is not  an element of SO*(3), i.e., orthogonal with determinant 1. 8This implementation uses the Matsumoto-Amano algorithm. ANote: the list of gates will be returned in right-to-left order, B i.e., as in the mathematical notation for matrix multiplication. 7 This is the opposite of the quantum circuit notation. pInput an exact matrix in U"(2), and output the corresponding  Clifford+T5 normal form. The behavior is undefined if the given  matrix is not an element of U$(2), i.e., unitary with determinant  1. ?We use a variant of the Kliuchnikov-Maslov-Mosca algorithm, as  implemented in %Quantum.Synthesis.MultiQubitSynthesis. ANote: the list of gates will be returned in right-to-left order, B i.e., as in the mathematical notation for matrix multiplication. 7 This is the opposite of the quantum circuit notation. qCompactly encode a E as an ". r Decode a E from its " encoding. This is the  inverse of q. sFEncode a Clifford operator as an integer in the range 0==|*+??|==191. tBDecode a Clifford operator from its integer encoding. This is the  inverse of s H@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrst5@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrst5KSRQPONMLIJGHTUVWXYZ[\]^_`abcdefghiEF@DCBAjklmnopqrst9@DCBAEFGHIJKSRQPONMLTUVWXYZ[\]^_`abcdefghijklmnopqrst Noneu>A type class for things that can be printed to LaTeX format. Minimal complete definition: v or w. vPrint to LaTeX format. w5Print to LaTeX format, with precedence. Analogous to . x8Generic showlatex-like method that factors out a common  denominator exponent. uvwxuvwxuvwxuvwx NoneyDecompose a unitary operator UE into Euler angles (uni__945__, uni__946__, uni__947__, uni__948__). # These angles are computed so that  U = [exp i uni__945__] R[sub z](uni__946__) R[sub x](uni__947__) R[sub z](uni__948__). zCompute the operator  U = [exp i uni__945__] R[sub z](uni__946__) R[sub x](uni__947__) R[sub z](uni__948__). from the given Euler angles. yzyzyzyz None {,An elementary rotation is either a combined x- and  z-rotation, applied at indices j and k, or a phase change  applied at index j.  } uni__948__ uni__947__ j k represents the operator  R[sub z] (uni__948__)R[sub x] (uni__947__), applied to levels j and k. [image ERot_zx.png]  | uni__952__ j represents the operator [exp i uni__952__] applied to level  j. [image ERot_phase.png] Note: when we use a list of {s to express a sequence of A operators, the operators are meant to be applied right-to-left, B i.e., as in the mathematical notation for matrix multiplication. 7 This is the opposite of the quantum circuit notation. ~=Convert a symbolic elementary rotation to a concrete matrix. 1Convert a sequence of elementary rotations to an n ==|?!%|==n -matrix.  Convert an n ==|?!%|==n/-matrix to a sequence of elementary rotations. ;Note: the list of elementary rotations will be returned in @ right-to-left order, i.e., as in the mathematical notation for E matrix multiplication. This is the opposite of the quantum circuit  notation. Construct a two-level n ==|?!%|==n,-matrix from a given 2==|?!%|==2-matrix and  indices j and k. Extract the phase of the jth diagonal entry of the given  matrix. &Perform a two-level operation on rows j and k of a matrix U, 0 such that the resulting matrix has a 0 in the (j,k )-position. D Return the inverse of the two-level operation used, as well as the  updated matrix.  Return a "random" unitary n ==|?!%|==n-matrix. These matrices will @ not quite be uniformly distributed; this function is primarily  meant to generate test cases. BGenerate a random matrix, decompose it, and then re-calculate the  matrix from the decomposition. {|}~ {|}~ {}|~ {}|~ NoneAA type class for Euclidean domains. A Euclidean domain is a ring : with a Euclidean function and a division with remainder. ;The Euclidean function for the Euclidean domain. This is a  function rank : R\&{0} ==|*%-$|== UNI__8469__ such that:  for all nonzero a, b ==|*+!?|== R, rank(a ) ==|**.$|== rank(ab);  if b ==|**..|== 0 and (q,r) = a  b, then either r =  0 or rank(r) < rank(b). Given a and b1==|**..|==0, return a quotient and remainder for  division of a by b. Specifically, return (q,r ) such that  a = qb + r, and such that r = 0 or rank(r) < rank(b). ,Calculate the remainder for the division of x by y . Assumes  that y ==|**..|== 0. +Calculate the quotient for the division of x by y , ignoring C the remainder, if any. This is typically, but not always, used in @ situations where the remainder is known to be 0 ahead of time.  Assumes that y ==|**..|== 0. ?Calculate the greatest common divisor in any Euclidean domain. 4Perform the extended Euclidean algorithm. On inputs x and  y, this returns (a,b,s,t,d ) such that:  d = gcd(x,y),  ax + by = d,  sx + ty = 0,  at - bs = 1. ?Find the inverse of a unit in a Euclidean domain. If the given  element is not a unit, return . >Determine whether an element of a Euclidean domain is a unit. Compute the inverse of a in R/ (p), where R is a Euclidean # domain. Note: this works whenever a and p are relatively  prime. If a and p" are not relatively prime, return . Check whether a is a divisor of b. Check whether a and b) are associates, i.e., differ at most by  a multiplicative unit. Given elements x and y! of a Euclidean domain, find the  largest k such that x can be written as y[sup k]z.  Return the pair (k, z). If x=0 or y is a unit, return (0, x). For y ==|**..|== 0, find the integer q closest to x / y. This  works regardless of whether x and/or y are positive or  negative. The distance q ==|*+??|== x / y is guaranteed to be in  (-1/2, 1/2]. NoneNone NoneBThis type class provides a primitive method for solving quadratic 7 equations. For many floating-point or fixed-precision 2 representations of real numbers, using the usual " quadratic  formula": results in a significant loss of precision. Instances of  the 2 class should provide an efficient high-precision  method when possible. qroottwo_quadratic a b c: solve the quadratic equation  ax uni__178__ + bx + c$ = 0. Return the pair of solutions (x uni__8321__, x uni__8322__)  with xuni__8321__ ==|**.$|== xuni__8322__, or " if no solution exists. Note that  the coefficients a, b, and c are taken to be of an exact = type; therefore instances have the opportunity to work with  infinite precision. Given b, c# ==|*+!?|== UNI__8474__[==|*+~.|==2]", consider the quadratic function f(t)  = t uni__178__ + bt + c.  If f(t$) = 0 has no real solutions, return .  If f(t) = 0 has real solutions tuni__8320__ ==|**.$|== tuni__8321__, return t' uni__8320__,  t'-uni__8321__ ==|*+!?|== UNI__8484__ such that t'uni__8320__ ==|**.$|== t uni__8320__, tuni__8321__ ==|**.$|== t'uni__8321__, and |t'uni__8320__ - tuni__8320__|,  |t'uni__8321__ - tuni__8321__| ==|**.$|== 1. Given a, b, c# ==|*+!?|== UNI__8474__[==|*+~.|==2] with a > 0, consider the quadratic  function f(t) = at uni__178__ + bt + c.  If f(t$) = 0 has no real solutions, return .  If f(t) = 0 has real solutions tuni__8320__ ==|**.$|== tuni__8321__, return (t' uni__8320__,  t'uni__8321__) such that t'uni__8320__ ==|**.$|== t uni__8320__, tuni__8321__ ==|**.$|== t'uni__8321__, and |t'uni__8320__ - tuni__8320__|,  |t'uni__8321__ - t uni__8321__| ==|**.$|== 10[sup -d], where d is the precision of the  fixed-point real number type. NoneHA state is a pair (D4, UNI__916__) of real positive definite matrices of / determinant 1. It encodes a pair of ellipses. 7A compact convex set is given by a bounding ellipse, a 2 characteristic function, and a line intersector. A line intersector% knows about some compact convex set  A. Given a straight line L&, it computes an approximation of the  intersection of L and A. More specifically, L# is given as a parametric equation p(t) =  v + tw, where v and w" ==|**..|== 0 are vectors. Given v and w, the  line intersector returns tuni__8320__ and tuni__8321__ such that p(t ) ==|*+!?|== A implies  t ==|*+!?|== [t uni__8320__, t uni__8321__]. 'Line intersectors should overestimate ("fatten") the convex set 7 slightly, to guard against possible round-off errors. The characteristic function of a set A inputs a point p,  and outputs  if p ==|*+!?|== A and  otherwise.  The point p. is given of an exact type, so characteristic ; functions have the opportunity to use infinite precision. An ellipse is given by an operator D and a center p; the  ellipse in this case is A = { v | (v-p)[sup ==|*??$|==] D (v-p) ==|**.$|== 1}. *An operator is a real 2==|?!%|==2-matrix. A point in the plane. Given two intervals A = [x uni__8320__, x uni__8321__] and B = [y uni__8320__, y uni__8321__] of Q real numbers, output all solutions uni__945__ ==|*+!?|== UNI__8484__[==|*+~.|==2] of the 1-dimensional  grid problem for A and B&. The list is produced lazily, and is + sorted in order of increasing uni__945__. Like , but only produce solutions a + b==|*+~.|==2 where  a+ has the same parity as the given integer. Given two intervals A = [x uni__8320__, x uni__8321__] and B = [y uni__8320__, y uni__8321__] of D real numbers, and a source of randomness, output a random solution . uni__945__ ==|*+!?|== UNI__8484__[==|*+~.|==2]' of the 1-dimensional grid problem for A and B. ?Note: the randomness is not uniform. To ensure that the set of y solutions is non-empty, we must have UNI__916__xUNI__916__y ==|**.%|== (1 + ==|*+~.|==2)uni__178__, where UNI__916__x =  xuni__8321__ ==|*+??|== x+uni__8320__ ==|**.%|== 0 and UNI__916__y = yuni__8321__ ==|*+??|== y4uni__8320__ ==|**.%|== 0. If there are no solutions  at all, the function returns . Like , but only produce solutions a + b ==|*+~.|==2  where a+ has the same parity as the given integer. Given intervals A = [x uni__8320__, x uni__8321__] and B = [y uni__8320__, y uni__8321__] , and an  integer kQ ==|**.%|== 0, output all solutions uni__945__ ==|*+!?|== UNI__8484__[==|*+~.|==2] / ==|*+~.|==2[sup k] of + the scaled 1-dimensional grid problem for A, B, and k. The ? list is produced lazily, and is sorted in order of increasing  uni__945__. Like  , but assume k" ==|**.%|== 1, take an additional 8 parameter uni__946__ ==|*+!?|== UNI__8484__[==|*+~.|==2] / ==|*+~.|==2[sup k](, and return only those uni__945__ such I that uni__946__ ==|*+??|== uni__945__ ==|*+!?|== UNI__8484__[==|*+~.|==2] / ==|*+~.|==2[sup k-1]. $Convert a point with coordinates in  to a point with  coordinates in any . The closed unit disk. .A closed rectangle with the given dimensions. Given bounded convex sets A and B, enumerate all solutions  u" ==|*+!?|== UNI__8484__[uni__969__]' of the 2-dimensional grid problem for A and B. Given bounded convex sets A and B, return a function that can  input a k4 and enumerate all solutions of the two-dimensional  scaled grid problem for A, B, and k. ;Note: a large amount of precomputation is done on the sets A and  B<, so it is beneficial to call this function only once for a B given pair of sets, and then possibly call the result many times  for different k/. In other words, for optimal performance, the $ function should be used like this:  + let solver = gridpoints2_scaled setA setB  let solutions0 = solver 0  let solutions1 = solver 1  ... =Note: the gridpoints are computed in some deterministic (but . unspecified) order. They are not randomized. Given bounded convex sets A and B, enumerate all solutions of 1 the two-dimensional scaled grid problem for all k ==|**.%|== 0. Each D solution is only enumerated once, and the solutions are enumerated  in order of increasing k. )Construct a 2==|?!%|==2-matrix, by rows. 6Extract the entries of a 2==|?!%|==2-matrix, by rows. $Convert an operator with entries in  to an operator with  entries in any . The (b,z>)-representation of a positive operator with determinant 1 is [ image bz.png] where b, z ==|*+!?|== UNI__8477__ and e > 0 with e uni__178__ = buni__178__ + 1. Create such an  operator from parameters b and z. 7Conversely, given a positive definite real operator of ' determinant 1, return the parameters (b, z). This is the  inverse of . For efficiency reasons, the  parameter z(, which is a logarithm, is modeled as a .  A version of  that returns (b, uni__955__[sup 2z])  instead of (b, z). D This is a critical optimization, as this function is called often, 5 and logarithms are relatively expensive to compute. )The determinant of a 2==|?!%|==2-matrix. >Compute the skew of a positive operator of determinant 1. We  define the skew& of a positive definite real operator D to be [image skew.png] /Compute the uprightness of a positive operator D. The  uprightness of D) is the ratio of the area of the ellipse  E = {v | v[sup ==|*??$|==]Dv/ ==|**.$|== 1} to the area of its bounding box  R. It is given by [image area.png] [image ellipse-rectangle.png] The skew/ of a state is the sum of the skews of the two  operators. The bias of a state is uni__950__ - z. The special grid operator R': a clockwise rotation by 45==|!+^|==. [image gridop-R.png] The special grid operator A#: a clockwise shearing with offset  2, parallel to the x-axis. [image gridop-A.png] The special grid operator A>==|*~!%|==uni__185__: a counterclockwise shearing with offset  2, parallel to the x-axis. [image gridop-Ai.png]  The operator A[sup k]. The special grid operator B#: a clockwise shearing with offset  ==|*+~.|==2, parallel to the x-axis. [image gridop-B.png] The special grid operator B>==|*~!%|==uni__185__: a counterclockwise shearing with offset  ==|*+~.|==2, parallel to the x-axis. [image gridop-Bi.png]  The operator B[sup k]. The special grid operator K. [image gridop-K.png]  The Pauli X' operator is a special grid operator. [image gridop-X.png] The Pauli operator Z is a special grid operator. [image gridop-Z.png] The special grid operator S1: a scaling by uni__955__ = 1+==|*+~.|==2 in the  xJ-direction, and by uni__955__==|*~!%|==uni__185__ = -1+==|*+~.|==2 in the y -direction. [image gridop-S.png]  The operator S2 is not used in the paper, but we use it here for D a more efficient implementation of large shifts. The point is that  S@ is a grid operator, but shifts in increments of 4, whereas the D Shift Lemma uses non-grid operators but shifts in increments of 2. The special grid operator S%==|*~!%|==uni__185__, the inverse of . [image gridop-Si.png] Return S[sup k]. ,Compute the right action of a grid operator G on a state (D, " UNI__916__). This is defined as: (D, UNI__916__) ==|*-.!|== G := (G[sup ==|*??$|==]DG, G[sup ==|*??^|==T] UNI__916__G[sup ==|*??^|==]). Given an operator D, compute uni__963__[sup k]Duni__963__[sup k]. 5Given an operator UNI__916__, compute uni__964__[sup k]UNI__916__uni__964__[sup k].  Compute the k-shift of a state (D,UNI__916__). An implementation of the A-Lemma. Given z and uni__950__, compute the  integer m such that the operator A[sup m] reduces the skew. An implementation of the B-Lemma. Given z and uni__950__, compute the  integer m such that the operator B[sup m] reduces the skew.  A version of  that inputs uni__955__[sup 2z] instead of z and  uni__955__[sup 2uni__950__]- instead of uni__950__. Compute the constant m such that the  operator A[sup m] reduces the skew.  A version of  that inputs uni__955__[sup 2z] instead of z and  uni__955__[sup 2uni__950__]- instead of uni__950__. Compute the constant m such that the  operator B[sup m] reduces the skew. 4An implementation of the Step Lemma. Input a state (D,UNI__916__). If @ the skew is > 15, produce a special grid operator whose action  reduces Skew(DV,UNI__916__) by at least 5%. If the skew is ==|**.$|== 15 and uni__946__ ==|**.%|== 0 P and z + uni__950__ ==|**.%|== 0, do nothing. Otherwise, produce a special grid P operator that ensures uni__946__ ==|**.%|== 0 and z + uni__950__ ==|**.%|== 0. >Repeatedly apply the Step Lemma to the given state, until the  skew is 15 or less. 1Given a pair of ellipses, return a grid operator G such that 2 the uprightness of each ellipse is greater than 1/ 6. This is  essentially the same as , except we do not assume that ) the input operators have determinant 1. Apply a linear transformation G to a point p. &Apply a special linear transformation G to an ellipse A. This  results in the new ellipse G(A) = { G(z) | z ==|*+!?|== A }. Apply a special grid operator G to a characteristic function. &Apply a special linear transformation G to a line A intersector. If the input line intersector was for a convex set  A2, then the output line intersector is for the set G(A)  = { G(z) | z ==|*+!?|== A }. &Apply a special linear transformation G to a convex set  A%. This results in the new convex set G(A) = { G(z) | z  ==|*+!?|== A }. +Calculate the bounding box for an ellipse. 5Calculate a bounding box for a convex set. Returns ((x uni__8320__, xuni__8321__),  (y uni__8320__, yuni__8321__)).  We write x `within` (a,b) for a ==|**.$|== x ==|**.$|== b, or  equivalently, x ==|*+!?|== [a, b]. 1Given an interval, return a slightly bigger one. +The constant uni__955__ = 1 + ==|*+~.|==2. ?The constant uni__955__==|*~!%|==uni__185__ = ==|*+~.|==2 - 1. Return uni__955__[sup k], where k+ ==|*+!?|== UNI__8484__. This works in any . Note that we can't use , because it requires k ==|**.%|== 0, nor ,  because it requires the  class. Return (-1)[sup k], where k ==|*+!?|== UNI__8484__. Given positive numbers b and x , return (n, r ) such that  x = r b[sup n] and  1 ==|**.$|== r < b$. In other words, let n = ==|*-+.|==log[sub b] x==|*-+!|== and  r = x b[sup ==|*+??|==n]". This can be more efficient than   ( b x1) depending on the type; moreover, it also works  for exact types such as  and ~. 2A version of the natural logarithm that returns a . The 2 logarithm of just about any value can fit into a ; so if C not a lot of precision is required in the mantissa, this function  is often faster than . !The inner product of two points. Subtract two points. BCalculute the inverse of an operator of determinant 1. Note: this C does not work correctly for operators whose determinant is not 1. KJJINone3Given uni__958__ ==|*+!?|== UNI__8484__[==|*+~.|==2], find t" ==|*+!?|== UNI__8484__[uni__969__] such that t[sup ==|*??$|==]t = uni__958__, if  such t exists, or return  otherwise. .Given an element uni__958__ ==|*+!?|== [bold D] [==|*+~.|==2], find t ==|*+!?|== [bold D] [uni__969__] such  that t[sup ==|*??$|==]t = uni__958__, if such t exists, or return   otherwise. 3Given uni__958__ ==|*+!?|== UNI__8484__[==|*+~.|==2], find t" ==|*+!?|== UNI__8484__[uni__969__] such that t[sup ==|*??$|==]t ~ uni__958__, if  such t exists, or  otherwise. Unlike , the E equation is only solved up to associates, i.e., up to a unit of the  ring. #Given a positive composite integer n, find a non-trivial factor  of n< using a simple Pollard-rho method. The expected runtime is  O(==|*+~.|==p ), where p/ is the size of the smallest prime factor. If  n is not composite (i.e., if n is prime or 1), this function  diverges. Given a factorization n = ab@ of some element of a Euclidean domain, find a factorization of n into relatively prime factors, [center n = u c[sub 1][sup k[sub 1]]" ==|*-.!|== ==|*?~.|== ==|*-.!|== c[sub m][sup k[sub m]],] where m ==|**.%|== 2, u is a unit, and c[sub 1], ==|*?~.|==, c[sub m] are  pairwise relatively prime. 1While this is not quite a prime factorization of n, it can be a E useful intermediate step for computations that proceed by recursion + on relatively prime factors (such as Euler's uni__966__-function, the + solution of Diophantine equations, etc.). ?Modular exponentiation, using the method of repeated squaring.   a k n computes a[sup k] (mod n). 1Compute a root of ==|*+??|==1 in UNI__8484__[sub n], where n > 0. If n is a  positive prime satisfying n/ ==|**.!|== 1 (mod 4), this succeeds within an > expected number of 2 ticks. Otherwise, it probably diverges. 1As a special case, if this function notices that n is not prime, 5 then it diverges without doing any additional work. Compute a root of a in UNI__8484__[sub n], where n > 0. If n is an  odd prime and a) is a non-zero square in UNI__8484__[sub n] , then this C succeeds in an expected number of 2 ticks. Otherwise, it probably  diverges. Given an integer n) ==|*+!?|== UNI__8484__, attempt to find t" ==|*+!?|== UNI__8484__[uni__969__] such that  t[sup ==|*??$|==]t ~ n , or return  if no such t exists. -This function is optimized for the case when n is prime, and = succeeds in an expected number of 2 ticks in this case. If n is - not prime, this function probably diverges. Given an integer n ==|*+!?|== UNI__8484__, find t" ==|*+!?|== UNI__8484__[uni__969__] such that t[sup ==|*??$|==]t  ~ n , if such t exists, or return  if no such t  exists.  This function alternately calls  and  attempts to factor n). Therefore, it will eventually succeed; F however, the runtime depends on how hard it is to factor uni__958__. Given a factorization n = q[sub 1][sup k[sub 1]]==|*-.!|====|*?~.|====|*-.!|==q[sub  m][sup k[sub m]] of an integer n, where q[sub 1], ==|*?~.|==,  q[sub m]% are pairwise relatively prime, find t" ==|*+!?|== UNI__8484__[uni__969__] such  that t[sup ==|*??$|==]t ~ n , if such t exists, or return   if no such t exists. Given a pair of integers (n, k), find t" ==|*+!?|== UNI__8484__[uni__969__] such that  t[sup ==|*??$|==]t ~ n[sup k] , if such t exists, or return   if no such t exists. 3Given uni__958__ ==|*+!?|== UNI__8484__[==|*+~.|==2]1 such that uni__958__ ~ uni__958__[sup ==|*??^|==], find t" ==|*+!?|== UNI__8484__[uni__969__] such that  t[sup ==|*??$|==]t ~ uni__958__, if such t exists, or return  if no  such t exists. 3Given uni__958__ ==|*+!?|== UNI__8484__[==|*+~.|==2]4 such that gcd(uni__958__, uni__958__[sup ==|*??^|==]) = 1, attempt to find  t" ==|*+!?|== UNI__8484__[uni__969__] such that t[sup ==|*??$|==]t ~ uni__958__, or return  if no  such t exists. JThis function is optimized for the case when uni__958__ is a prime in the  ring UNI__8484__[==|*+~.|==2]4. In this case, it succeeds quickly, in an expected H number of 2 ticks. If uni__958__ is not prime, this function probably  diverges. 3Given uni__958__ ==|*+!?|== UNI__8484__[==|*+~.|==2]4 such that gcd(uni__958__, uni__958__[sup ==|*??^|==] ) = 1, find t" ==|*+!?|== UNI__8484__[uni__969__]  such that t[sup ==|*??$|==]t ~ uni__958__, if such t exists, or return   if no such t exists.  This function alternately calls  and G attempts to factor uni__958__. Therefore, it will eventually succeed. F However, the runtime depends on how hard it is to factor uni__958__. #Given a factorization uni__958__ = q[sub 1][sup k[sub 1]]==|*-.!|====|*?~.|====|*-.!|==q[sub  m][sup k[sub m]]6 of some uni__958__ ==|*+!?|== UNI__8484__[==|*+~.|==2], where q[sub 1], ==|*?~.|==,  q[sub m]% are pairwise relatively prime, find t" ==|*+!?|== UNI__8484__[uni__969__] such  that t[sup ==|*??$|==]t ~ uni__958__, if such t exists, or return  # if it can be proven not to exist. Given a pair (uni__958__, k5), with uni__958__ ==|*+!?|== UNI__8484__[==|*+~.|==2] and k ==|**.%|== 0, find t ==|*+!?|==  UNI__8484__[uni__969__] such that t[sup ==|*??$|==]t ~ uni__958__[sup k] , if such t exists, or  return  if no such t exists. NoneBInformation about the status of an attempt to solve a Diophantine  equation. , means the Diophantine equation was solved;  6 means that it was proved that there was no solution;  4 means that the question was not decided within the  allotted time. *Output a unitary operator in the Clifford+T group that  approximates R[sub z](uni__952__) = [exp ==|*+??|==i uni__952__Z/2] to within uni__949__ in the A operator norm. This operator can then be converted to a list of  gates with J. The parameters are:  a source of randomness g;  the angle uni__952__;  the precision b5 ==|**.%|== 0 in bits, such that uni__949__ = 2[sup -b]; * an integer that determines the amount of "effort" to put into A factoring. A larger number means more time spent on factoring.  A good default for this is 25. Note: the argument theta( is given as a symbolic real number. It C will automatically be expanded to as many digits as are necessary D for the internal calculation. In this way, the caller can specify,  e.g., an angle of pi/128 :: ,, without having to worry 1 about how many digits of uni__960__ to specify.  A version of + that returns a list of gates instead of a  matrix. ANote: the list of gates will be returned in right-to-left order, B i.e., as in the mathematical notation for matrix multiplication. 7 This is the opposite of the quantum circuit notation.  A version of $ that also returns some statistics:  log[sub 0.5]' of the actual approximation error (or  if the ; error is 0), and a data structure with information on the  candidates tried. The uni__949__-regionF for given uni__949__ and uni__952__ is a convex subset of the closed  unit disk, given by [nobr u ==|*-.!|== z$ ==|**.%|== 1 - uni__949__uni__178__/2], where [nobr z =  [exp ==|*+??|==i uni__952__/2]]b, and ==|*??.|====|*-.!|====|*??!|== denotes the dot product of UNI__8477__uni__178__ (identified  with UNI__8450__). [center [image Re.png]] =The internal implementation of the ellipse-based approximate @ synthesis algorithm. The parameters are a source of randomness g, % the angle uni__952__, the precision b( ==|**.%|== 0 in bits, and an amount of  "effort" to put into factoring. 3The outputs are a unitary operator in the Clifford+T group that  approximates R[sub z]8(uni__952__) to within uni__949__ in the operator norm;  log[sub 0.5] of the actual error, or  if the error is 0; % and the number of candidates tried. MNote: the parameter uni__952__ must be of a real number type that has enough @ precision to perform intermediate calculations; this typically & requires precision O(uni__949__[sup 2]'). A more user-friendly function that 1 selects the required precision automatically is .   None;Backward compatible interface to the approximate synthesis  algorithm. The parameters are: % an angle uni__952__, to implement a R[sub z](uni__952__) = [exp ==|*+??|==i uni__952__Z/2]  gate;  a precision b5 ==|**.%|== 0 in bits, such that uni__949__ = 2[sup -b];  a source of randomness g. *Output a unitary operator in the Clifford+T group that  approximates R[sub z]=(uni__952__) to within uni__949__ in the operator norm. This 8 operator can then be converted to a list of gates with  J. Note: the argument theta( is given as a symbolic real number. It C will automatically be expanded to as many digits as are necessary D for the internal calculation. In this way, the caller can specify,  e.g., an angle of /128 :: ,, without having to worry 1 about how many digits of uni__960__ to specify.  A version of $ that also returns some statistics:  log[sub 0.1]' of the actual approximation error (or  if the 2 error is 0), and the number of candidates tried.  A version of + that returns a list of gates instead of a ( matrix. The inputs are the same as for . ANote: the list of gates will be returned in right-to-left order, B i.e., as in the mathematical notation for matrix multiplication. 7 This is the opposite of the quantum circuit notation.  !"#$%&'()*+,-./0123456789:;<=>?@<ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~XZ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|} ~                                -       !"#$%&%'%()*)+),)-).)/%0!123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!                       %        newsynth-0.2Quantum.Synthesis.StepCompQuantum.Synthesis.CliffordQuantum.Synthesis.ArcTan2Quantum.Synthesis.SymRealQuantum.Synthesis.RingQuantum.Synthesis.Matrix%Quantum.Synthesis.MultiQubitSynthesisQuantum.Synthesis.CliffordTQuantum.Synthesis.LaTeXQuantum.Synthesis.EulerAngles'Quantum.Synthesis.RotationDecomposition!Quantum.Synthesis.EuclideanDomain#Quantum.Synthesis.QuadraticEquationQuantum.Synthesis.GridProblemsQuantum.Synthesis.DiophantineQuantum.Synthesis.GridSynthQuantum.Synthesis.Newsynth Quantum.Synthesis.Ring.FixedPrecQuantum.Synthesis.Ring.SymRealStepCompTickDonetickuntickforwardis_done get_resultsubtaskspeedupparallel with_counterrunrun_with_steps run_boundeddivergeparallel_firstparallel_maybeparallel_list_maybeAxisAxis_SHAxis_HAxis_I ToClifford to_cliffordClifford clifford_X clifford_Y clifford_Z clifford_H clifford_S clifford_SH clifford_E clifford_Wclifford_decomposeclifford_decompose_coset clifford_id clifford_mult clifford_invclifford_tconjArcTan2arctan2ToRealto_realSymRealACoshATanhASinhCoshTanhSinhACosATanASinCosTanSinPowerLogSqrtExpEulerPiRecipSignumAbsNegateDivTimesMinusPlusDecimalConstdynamic_fixedprecdynamic_fixedprec2integerfloatconst_piconst_enegativepositive plus_term minus_term times_termdiv_term power_term unary_fununary_op binary_fun binary_opexp6exp7exp8exp10 parenthesized expression parse_SymRealParityparityToQOmegatoQOmegaDenomExpdenomexpdenomexp_factor WholePart from_wholeto_wholeRealPartrealToDyadic maybe_dyadicQOmegaDOmegaZOmegaOmegaCFloatCDouble QRComplex DRComplexQComplexDComplexZComplexCplxQRootTwoDRootTwoZRootTwoRootTwo Rationals ToRationals unRationalsDyadicZ2OddEvenFloorfloor_of ceiling_of NormedRingnormAdjoint2adj2Adjointadj OmegaRingomega ComplexRingi RootHalfRingroothalf RootTwoRingroottwoHalfRinghalf fromDyadicRingdecompose_dyadicinteger_of_dyadicshowsPrec_rational fromRationals fromZRootTwo zroottwo_root fromDRootTwo fromQRootTwo fromZComplex fromDComplex fromQComplex fromDRComplex fromQRComplex omega_real fromZOmegazroottwo_of_zomega fromDOmega fromQOmega to_dyadicdenomexp_decomposeshowsPrec_DenomExplobitlog2hibitintsqrtSO3U2MatrixVectorConsNilNatnnatnatNNatSuccZeroTen_andTenNineEightSevenSixFiveFourThreeTwoOnefromNNatvector_singleton vector_lengthlist_of_vectorvector_zipwith vector_map vector_enumvector_of_functionvector vector_index vector_repeatvector_transpose vector_foldl vector_foldr vector_tail vector_head vector_appendvector_sequenceunMatrix matrix_size.+..-. matrix_map matrix_enummatrix_of_function scalarmult scalardiv.*. null_matrixmatrix_transposeadjoint matrix_indexmatrix_entriesmatrix_sequencetr hs_sqnormstack_verticalstack_horizontaltensor_verticalconcat_verticaltensor_horizontalconcat_horizontaltensoroplusmatrix_controlledmatrix_of_columnsmatrix_of_rowsmatrixcolumns_of_matrixrows_of_matrix matrix2x2from_matrix2x2 matrix3x3 matrix4x4column3 from_column3 column_matrixcnotswapzrot TwoLevelAlt TL_omega_altTL_WTL_TiHTTL_iX ResidueTypeRT_1010RT_0001RT_0000TwoLevelTL_omegaTL_TTL_HTL_XIndexResidueresidueinvert_twolevelinvert_twolevelstwolevel_matrixonelevel_matrixmatrix_of_twolevelmatrix_of_twolevels list_insert transform_at transform_at2 list_pairs log_omega omega_power reduce_ZOmega opX_zomega opH_zomegaapply_twolevel_zomegaapply_twolevels_zomega residue_type residue_shiftresidue_type_shiftresidue_offset reduciblerow_step reduce_columnsynthesis_nqubittwolevels_of_twolevelaltsinvert_twolevels_alt row_step_altreduce_column_altsynthesis_nqubit_alt SyllablesSApp_SHTSApp_HTS_TS_I NormalForm FromGates from_gatesToGatesto_gatesGateWETSHZYX invert_gatesconvertu2_Xu2_Yu2_Zu2_Hu2_Su2_Tu2_Eu2_W u2_of_gateso3_Xso3_Yso3_Zso3_Hso3_Sso3_Eso3_T so3_of_gate so3_of_u2so3_of_cliffordclifford_of_so3normalform_appendnf_idnf_multnf_inv normalizesynthesis_bloch synthesis_u2normalform_packnormalform_unpack clifford_packclifford_unpack ShowLaTeX showlatex showlatex_pshowlatex_denomexp_p euler_anglesmatrix_of_euler_angles ElementaryRot ERot_phaseERot_zxmatrix_of_elementarymatrix_of_elementariesrotation_decompositiontwolevel_matrix_of_matrix get_phaserowoprandom_unitarytestEuclideanDomainrankdivmod euclid_mod euclid_div euclid_gcdextended_euclideuclid_inverseis_unitinv_modeuclid_divideseuclid_associateseuclid_extract_powerrounddiv Quadratic quadratic OperatorPair ConvexSetLineIntersectorCharFunEllipseOperatorPoint gridpointsgridpoints_paritygridpoint_randomgridpoint_random_paritygridpoints_scaledgridpoints_scaled_paritypoint_fromDRootTwounitdisk rectangle gridpoints2gridpoints2_scaledgridpoints2_increasing toOperator fromOperatorop_fromDRootTwooperator_from_bzoperator_to_bzoperator_to_bl2zdet operator_skew uprightnessskewbiasopRopAopA_inv opA_poweropBopB_inv opB_poweropKopXopZopSopS_inv opS_poweraction shift_sigma shift_tau shift_statelemma_Alemma_B lemma_A_l2 lemma_B_l2 step_lemma reduction to_uprightpoint_transformellipse_transformcharfun_transformlineintersector_transformconvex_transformboundingbox_ellipse boundingboxwithinfatten_intervallambda lambda_inv lambdapower signpowerfloorloglogBase_doubleiprod point_subspecial_inverse diophantinediophantine_dyadicdiophantine_associate find_factorrelatively_prime_factors power_modroot_of_negative_oneroot_modDStatusTimeoutFailSuccess gridsynthgridsynth_gatesgridsynth_statsepsilon_regiongridsynth_internalnewsynthnewsynth_statsnewsynth_gatesbase Data.MaybeNothing$fShowStepComp$fMonadStepCompGHC.BaseStringconj2conj3cinvtconj$fToCliffordAxis$fToClifford[]$fToCliffordChar$fToCliffordClifford$fShowClifford GHC.Floatatan2 RealFloat$fArcTan2FixedPrec$fArcTan2Float$fArcTan2Doubleghc-prim GHC.Classes== $fToReal[]$fToRealFixedPrec $fToRealFloat$fToRealDouble $fToRealInt$fToRealInteger $fToRealRatio$fToRealSymReal$fArcTan2SymReal$fFloatingSymReal$fFractionalSymReal $fNumSymReal $fShowSymRealGHC.ShowShow Data.ComplexComplexGHC.RealRationalfloorceilingGHC.NumNum+-*abssignum Fractionalshow integer-gmpGHC.Integer.TypeInteger$fParityRootTwo $fParitya$fToQOmegaOmega$fToQOmegaCplx$fToQOmegaDyadic$fToQOmegaRootTwo$fToQOmegaRatio$fToQOmegaInteger$fDenomExpCplx $fDenomExp[] $fDenomExp() $fDenomExp(,)$fDenomExpOmega$fDenomExpRootTwo$fWholePartCplxCplx$fWholePart[][]$fWholePart()()$fWholePart(,)(,)$fWholePartOmegaOmega$fWholePartRootTwoRootTwo$fWholePartDyadicInteger$fRealPartOmegaRootTwo$fRealPartCplxa$fToDyadicOmegaOmega$fToDyadicCplxCplx$fToDyadicRootTwoRootTwo$fToDyadicRationalsDyadic$fToDyadicRatioDyadic$fToDyadicDyadicDyadic $fShowCplx $fShowOmega$fOmegaRingOmega$fOmegaRingOmega0$fNormedRingOmega$fAdjoint2Omega$fAdjointOmega$fComplexRingOmega$fRootTwoRingOmega$fRootHalfRingOmega$fHalfRingOmega$fFractionalOmega $fNumOmega $fShowOmega0$fNormedRingCplx$fAdjoint2Cplx $fAdjointCplx$fRootTwoRingCplx$fRootHalfRingCplx$fHalfRingCplx$fComplexRingCplx$fFractionalCplx $fNumCplx $fShowCplx0$fFloorRootTwo$fNormedRingRootTwo$fAdjoint2RootTwo$fAdjointRootTwo$fComplexRingRootTwo$fRootHalfRingRootTwo$fHalfRingRootTwo$fRootTwoRingRootTwo$fFractionalRootTwo $fShowRootTwo $fOrdRootTwo $fNumRootTwo$fShowRationals$fAdjoint2Dyadic$fAdjointDyadic$fHalfRingDyadic $fNumDyadic $fOrdDyadic $fEqDyadic $fShowDyadic $fRealDyadic $fAdjoint2Z2 $fAdjointZ2$fNumZ2$fShowZ2 $fFloorDouble $fFloorFloat $fFloorRatio$fFloorInteger$fNormedRingInteger$fAdjoint2Ratio $fAdjoint2Int$fAdjoint2Integer$fAdjointComplex$fAdjointRatio$fAdjointFloat$fAdjointDouble $fAdjointInt$fAdjointInteger $fOmegaRinga$fComplexRingComplex$fRootHalfRingComplex$fRootHalfRingFloat$fRootHalfRingDouble$fRootTwoRingComplex$fRootTwoRingFloat$fRootTwoRingDouble$fHalfRingComplex$fHalfRingRatio$fHalfRingFloat$fHalfRingDouble$fRingaGHC.List replicate Control.Monadsequence$fComplexRingMatrix$fRootTwoRingMatrix$fRootHalfRingMatrix$fHalfRingMatrix$fAdjoint2Matrix$fAdjointMatrix $fNumMatrix$fDenomExpMatrix$fWholePartMatrixMatrix$fToDyadicMatrixMatrix $fShowMatrix $fShowMatrix0 $fShowMatrix1 $fShowMatrix2$fDenomExpVector$fWholePartVectorVector$fToDyadicVectorVector $fShowVector $fEqVector $fNatSucc $fNatZero $fShowNNat$fResidueMatrixMatrix$fResidueVectorVector$fResidueCplxCplx $fResidue[][] $fResidue()()$fResidue(,)(,)$fResidueRootTwoRootTwo$fResidueOmegaOmega$fResidueIntegerZ2$fFromGatesInteger$fToGatesInteger$fToGatesMatrix$fToGatesTwoLevel$fToGatesMatrix0$fFromGatesNormalForm$fShowNormalForm$fToGatesSyllables$fToGatesNormalForm$fToCliffordMatrix$fFromGatesMatrix$fFromGatesMatrix0 $fFromGates[]$fFromGates[]0$fToGatesClifford $fToGatesAxis $fToGatesChar $fToGates[] $fToGatesGate showsPrec$fShowLaTeXSymReal $fShowLaTeX[]$fShowLaTeXMatrix$fShowLaTeXMatrix0$fShowLaTeXOmega$fShowLaTeXDouble$fShowLaTeXCplx$fShowLaTeXOmega0$fShowLaTeXRootTwo$fShowLaTeXDyadic$fShowLaTeXRatio$fShowLaTeXMatrix1$fShowLaTeXOmega1$fShowLaTeXInteger$fShowLaTeX[]0$fShowLaTeXTwoLevel$fEuclideanDomainOmega$fEuclideanDomainRootTwo$fEuclideanDomainCplx$fEuclideanDomainInteger$fFloorFixedPrec$fAdjoint2FixedPrec$fAdjointFixedPrec$fHalfRingFixedPrec$fRootTwoRingFixedPrec$fRootHalfRingFixedPrec$fAdjoint2SymReal$fAdjointSymReal$fHalfRingSymReal$fRootTwoRingSymReal$fRootHalfRingSymReal int_quadraticqroottwo_quadratic_fixedprec$fQuadraticFixedPrec GHC.TypesTrueFalseDouble^**FloatinglogBaselog$fShowConvexSetdioph_int_assoc_primedioph_int_assocdioph_int_assoc_powersdioph_int_assoc_powerdioph_zroottwo_selfassociatedioph_zroottwo_assoc_primedioph_zroottwo_assocdioph_zroottwo_assoc_powersdioph_zroottwo_assoc_powerpi