The Quipper System

Algorithms.QLS.RealFunc

Description

Define various analytic functions for FDouble and QDouble.

Synopsis

# Some analytic functions on FDouble.

Approximation of the sine function using Taylor series.

Implementation of the sine function valid on the whole domain of FDouble.

Implementation of the cosine function valid on the whole domain of FDouble.

Auxiliary function for local_sqrt.

Approximation of the square root using iterative means.

The function magnitude defined for FDouble.

rotate :: FDouble -> FDouble -> FDouble -> FDouble -> FDouble -> FDouble -> (FDouble, FDouble) Source #

Apply the matrix

 ( a b )
( c d )

to the column vector (x,y).

approx_atan2_aux :: FDouble -> FDouble -> (FDouble, FDouble, FDouble) -> (FDouble, FDouble, FDouble) -> (FDouble, FDouble, FDouble) Source #

Auxiliary function for approx_atan2.

Definition of atan2 using a CORDIC method. Assume (x,y) is in first quadrant and that x > y.

Definition of atan2 using a CORDIC method. x and y can be any FDouble.

The function mkPolar defined for FDouble.

class QFloating a where Source #

A type class for quantum floating-point numbers.

Minimal complete definition

Methods

q_sin :: a -> Circ a Source #

Quantum implementation of the sine function.

q_cos :: a -> Circ a Source #

Quantum implementation of the cosine function.

Instances

 # Methods

Quantum implementation of atan2 on QDouble.

Quantum implementation of magnitude on QDouble.

Quantum implementation of mkPolar on QDouble.

q_Re :: (QDouble, QDouble) -> Circ QDouble Source #

Quantum implementation of Re on QDouble: a quantum complex is a pair of two QDoubles.

q_Im :: (QDouble, QDouble) -> Circ QDouble Source #

Quantum implementation of Im on QDouble: a quantum complex is a pair of two QDoubles.

# Template subroutines of analytic functions.

Template version of sin.

Template version of cos.

Template version of atan2.

# Template subroutines for dealing with quantum complex number encoded as pairs of QDouble.

Template version of mkPolar.

Template version of the constructor :+ of Complex.

Template version of magnitude.

Template version of realPart.

Template version of imagPart.

# Orphan instances

 # Methods # MethodsfloatRange :: FDouble -> (Int, Int) #decodeFloat :: FDouble -> (Integer, Int) #