yap-examples-0.1: examples of the algebraic classes in the yap package
Copyright(c) Ross Paterson 2011
LicenseBSD-style (see the file LICENSE)
Maintainer[email protected]
Stabilityprovisional
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Data.YAP.WeylAlgebra

Description

An example instance of the algebraic classes: Weyl algebras.

Synopsis

Weyl algebras

data Weyl a Source #

The (first) Weyl algebra over a, consisting of differential operators of the form \[ p_0(x) + p_1(x) \partial_x + \cdots + p_n(x) \partial_x^n \] where each \(p_i(x)\) is a polynomial in \(x\) and each \(\partial_x^i\) is the differentiation operator with respect to \(x\) repeated \(i\) times.

Instances

Instances details
AdditiveFunctor Weyl Source # 
Instance details

Defined in Data.YAP.WeylAlgebra

Methods

mapAdditive :: (AdditiveMonoid a, AdditiveMonoid b) => (a -> b) -> Weyl a -> Weyl b #

(Eq a, Show a, AdditiveMonoid a) => Show (Weyl a) Source # 
Instance details

Defined in Data.YAP.WeylAlgebra

Methods

showsPrec :: Int -> Weyl a -> ShowS #

show :: Weyl a -> String #

showList :: [Weyl a] -> ShowS #

(Eq a, AdditiveMonoid a) => Eq (Weyl a) Source # 
Instance details

Defined in Data.YAP.WeylAlgebra

Methods

(==) :: Weyl a -> Weyl a -> Bool #

(/=) :: Weyl a -> Weyl a -> Bool #

(Ord a, AdditiveMonoid a) => Ord (Weyl a) Source # 
Instance details

Defined in Data.YAP.WeylAlgebra

Methods

compare :: Weyl a -> Weyl a -> Ordering #

(<) :: Weyl a -> Weyl a -> Bool #

(<=) :: Weyl a -> Weyl a -> Bool #

(>) :: Weyl a -> Weyl a -> Bool #

(>=) :: Weyl a -> Weyl a -> Bool #

max :: Weyl a -> Weyl a -> Weyl a #

min :: Weyl a -> Weyl a -> Weyl a #

AbelianGroup a => AbelianGroup (Weyl a) Source #

Pointwise negation

Instance details

Defined in Data.YAP.WeylAlgebra

Methods

(-) :: Weyl a -> Weyl a -> Weyl a #

negate :: Weyl a -> Weyl a #

gtimes :: (AbelianGroup b, ToInteger b) => b -> Weyl a -> Weyl a #

AdditiveMonoid a => AdditiveMonoid (Weyl a) Source #

Pointwise addition

Instance details

Defined in Data.YAP.WeylAlgebra

Methods

(+) :: Weyl a -> Weyl a -> Weyl a #

zero :: Weyl a #

atimes :: ToInteger b => b -> Weyl a -> Weyl a #

FromRational a => FromRational (Weyl a) Source # 
Instance details

Defined in Data.YAP.WeylAlgebra

Methods

fromRational :: Rational -> Weyl a #

Ring a => Ring (Weyl a) Source # 
Instance details

Defined in Data.YAP.WeylAlgebra

Methods

fromInteger :: Integer -> Weyl a #

Semiring a => Semiring (Weyl a) Source #

Composition of operators

Instance details

Defined in Data.YAP.WeylAlgebra

Methods

(*) :: Weyl a -> Weyl a -> Weyl a #

one :: Weyl a #

fromNatural :: Natural -> Weyl a #

rescale :: Weyl a -> Weyl a -> (Weyl a, Weyl a, Weyl a -> Weyl a) #

Construction

fromPolynomial :: Polynomial a -> Weyl a Source #

Operator representing multiplication by a polynomial

diff :: Semiring a => Weyl a Source #

Derivative operator, i.e. \(\partial_x\), satisfying

fromCoefficients :: [Polynomial a] -> Weyl a Source #

Construct an operator from a list of coefficients of the iterated differential operators in order of increasing number of iterated derivatives.

Queries

order :: (Eq a, AdditiveMonoid a) => Weyl a -> Int Source #

The order of a differential operator.

coefficients :: (Eq a, AdditiveMonoid a) => Weyl a -> [Polynomial a] Source #

Coefficients of the iterated differential operators in order of increasing number of iterations, and with no trailing zeros.

evaluate :: Semiring a => Weyl a -> Polynomial a -> Polynomial a Source #

Evaluate an operator on a given polynomial.

evaluateWith :: (Eq a, AdditiveMonoid a, Differentiable b) => Weyl a -> (a -> b) -> b -> b -> b Source #

Evaluate an operator, given embeddings of values and the identity polynomial.