The Quipper System

Safe HaskellNone

Quipper.Algorithms.QLS.RealFunc

Description

Define various analytic functions for FDouble and QDouble .

Synopsis

Some analytic functions on FDouble .

approx_sin :: FDouble -> FDouble Source #

Approximation of the sine function using Taylor series.

template_approx_sin :: Circ (QDouble -> Circ QDouble) Source #

local_sin :: FDouble -> FDouble Source #

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

template_local_sin :: Circ (QDouble -> Circ QDouble) Source #

local_cos :: FDouble -> FDouble Source #

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

template_local_cos :: Circ (QDouble -> Circ QDouble) Source #

listAngle :: [Double] Source #

template_listAngle :: Circ [QDouble] Source #

listCos :: [Double] Source #

template_listCos :: Circ [QDouble] Source #

listSin :: [Double] Source #

template_listSin :: Circ [QDouble] Source #

list_values :: [(FDouble, FDouble, FDouble)] Source #

template_list_values :: Circ [(QDouble, QDouble, QDouble)] Source #

approx_sqrt :: Int -> FDouble -> FDouble Source #

Auxiliary function for local_sqrt .

template_approx_sqrt :: Circ (Int -> Circ (QDouble -> Circ QDouble)) Source #

local_sqrt :: FDouble -> FDouble Source #

Approximation of the square root using iterative means.

template_local_sqrt :: Circ (QDouble -> Circ QDouble) Source #

local_mag :: FDouble -> FDouble -> FDouble Source #

The function magnitude defined for FDouble . Calculate the non-negative magnitude of a complex number.

template_local_mag :: Circ (QDouble -> Circ (QDouble -> Circ QDouble)) Source #

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

Apply the matrix

 ( a b )
 ( c d )

to the column vector (x,y).

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

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

Auxiliary function for approx_atan2 .

template_approx_atan2_aux :: Circ (a -> Circ (QDouble -> Circ ((QDouble, QDouble, QDouble) -> Circ ((QDouble, QDouble, QDouble) -> Circ (QDouble, QDouble, QDouble))))) Source #

approx_atan2 :: FDouble -> FDouble -> FDouble Source #

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

template_approx_atan2 :: Circ (QDouble -> Circ (QDouble -> Circ QDouble)) Source #

local_atan2 :: FDouble -> FDouble -> FDouble Source #

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

template_local_atan2 :: Circ (QDouble -> Circ (QDouble -> Circ QDouble)) Source #

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

The function mkPolar defined for FDouble . Form a complex number from polar components of magnitude and phase.

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

class QFloating a where Source #

A type class for quantum floating-point numbers.

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

q_atan2 :: QDouble -> QDouble -> Circ QDouble Source #

Quantum implementation of atan2 on QDouble .

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

Quantum implementation of magnitude on QDouble .

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

Quantum implementation of mkPolar on QDouble .

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

Quantum implementation of realPart on QDouble : return the real part of a complex number. A quantum complex is a pair of two QDouble s.

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

Quantum implementation of imagPart on QDouble : return the imaginary part of a copmlex number. A quantum complex is a pair of two QDouble s.

my_test_fdouble :: IO () Source #

Template subroutines of analytic functions.

template_sin :: Circ (QDouble -> Circ QDouble) Source #

Template version of sin .

template_cos :: Circ (QDouble -> Circ QDouble) Source #

Template version of cos .

template_atan2 :: Circ (QDouble -> Circ (QDouble -> Circ QDouble)) Source #

Template version of atan2 .

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

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

Template version of mkPolar .

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

Template version of the constructor :+ of Complex .

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

Template version of magnitude .

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

Template version of realPart .

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

Template version of imagPart .

Orphan instances

AltStyle によって変換されたページ (->オリジナル) /