Re: positive definite matrix predicate

Tim Daly <[email protected]> Mon, 28 Dec 2009 11:47:19 -0500
Newsgroups gmane.comp.mathematics.axiom.user
Message-ID <[email protected]>
Konstantin L. Metlov wrote:
>> Definitely avoid subdomains. They require support from the interpreter.
>> There are only 2 subdomains that have been properly implemented in Axiom,
>> PositiveInteger and NonNegativeInteger and both required a lot of effort.
>>     
> Even if what I really want is just check the predicate ?
>
> >From what I've read in "The AXIOM System" J.H. Davenport it seemed like the 
> right feature to use for this... Yes, I understand that only the interpreter 
> would automatically identify the matrix in its output as, let's say, 
> Hermitean. In the SPAD code I'd write that my function requires a Hermitian 
> matrix and will have to make an explicit coercion (which would check the 
> predicate and ensure it is a Hermitian indeed or signal an error that it is 
> not). For all the other purposes Hermitean matrix would be just a 
> SquareMatrix.
>
> I was thinking about defining a domain, but the problem, which turned this 
> idea down, that this domain would not be closed. Yes, the sum of Hermitian 
> (and positive definite) matrices is Hermitian (positive definite) too, but 
> their product is only Hermitian if they commute. This seemed (on my current, 
> almost non-existant, level of knowledge of Axiom) to be hard to capture by a 
> type system... at least by a static one. The type of the result of the 
> multiplication would depend on whether two particular matrices commute.
>
> May be it is impossible to represent in Axiom ? Which would explain why it 
> does not have these basic notions built into its matrix algebra...
>   
I don't think it is impossible to represent in the algebra. The usual 
way to restrict a result is
to define a retractIfCan or coerceIfCan function that will attempt to 
return a restricted result.
If the retraction (of type Union(restrictedtype,"failed")) returns 
"failed" then the wider result
is used.
> With the best regards,
>                          Konstantin.
>
> p.s. Is this feature (subdomains) going to be removed ?
>   
No. Subdomains will continue to exist.
>
> _______________________________________________
> Axiom-mail mailing list
> [email protected]
> http://lists.nongnu.org/mailman/listinfo/axiom-mail
>
>