Thanks!

Just a question. Are there any guidelines as to what packages/domains, in 
general, one needs to expose, first in order to run similar routines?
The official documention, book.pdf, does not cover these functions and 
there were no online examples illustrating the usage.

On Tuesday, December 12, 2023 at 10:22:41 AM UTC-6 jg wrote:

> Hi Sid, two points: 
>
> 1.VectorSpaceBasis is not exposed, so interpreter cannot find its 
> functions.
>
> 2. coordinatesIfCan requires as second argument a basis, i.e. an element 
> of VectorSpaceBasis(F), not just a list of vectors.
>
> Here is the corrected code:
>
> (1) -> )r isBasis
> )expose VectorSpaceBasis
>
>    VectorSpaceBasis is already explicitly exposed in frame frame1
> F ==> PF 11
>
>                                                                               
>             
> Type: Void
> VF ==> Vector F
>
>                                                                               
>             
> Type: Void
> (v1,v2,v3) : VF
>
>                                                                               
>             
> Type: Void
> v1 := [1,1,2]
>
>
>    (4)  [1, 1, 2]
>                                                                         
> Type: Vector(PrimeField(11))
> v2 := [2,1,2]
>
>
>    (5)  [2, 1, 2]
>                                                                         
> Type: Vector(PrimeField(11))
> v3 := [1,2,1]
>
>
>    (6)  [1, 2, 1]
>                                                                         
> Type: Vector(PrimeField(11))
>
>
> M : Matrix F := [v1,v2,v3]
>
>
>         +1  1  2+
>         |       |
>    (7)  |2  1  2|
>         |       |
>         +1  2  1+
>                                                                         
> Type: Matrix(PrimeField(11))
> rank M
>
>
>    (8)  3
>                                                                               
>  
> Type: PositiveInteger
> isBasis?([v1,v2,v3])
>
>
>    (9)  true
>                                                                               
>          
> Type: Boolean
> w : VF := [2,3,10]
>
>
>    (10)  [2, 3, 10]
>                                                                         
> Type: Vector(PrimeField(11))
> b := basis [v1,v2,v3]
>
>
>    (11)  VectorSpace [[1, 1, 2], [2, 1, 2], [1, 2, 1]]
>                                                               Type: 
> VectorSpaceBasis(PrimeField(11))
> coordinatesIfCan(w,b)
>
>
>    (12)  [8, 5, 6]
>                                                              Type: 
> Union(Vector(PrimeField(11)),...)
>
>
>
>
> Am 12.12.23 um 16:18 schrieb Sid Andal:
>
> The function isBasis?() returns with non-trivial linear combination when
> applied to linearly independent vectors:
>
> (1) -> F ==> PF 11
> (2) -> VF ==> Vector F
> (9) -> (v1,v2,v3) : VF
>
> (11) -> v1 := [1,1,2]
>
>    (11)  [1, 1, 2]
>
> (12) -> v2 := [2,1,2]
>
>    (12)  [2, 1, 2]
>
> (13) -> v3 := [1,2,1]
>
>    (13)  [1, 2, 1]
>
> (14) -> M : Matrix F := [v1,v2,v3]
>
>          ┌1  1  2┐
>          │           │
>          │2  1  2│
>          │           │
>          └1  2  1┘
>
> (15) -> rank M
>
>    (15)  3
>
> Applying isBasis:
>
> (17) -> isBasis?([v1,v2,v3])
>
>    (17)  isBasis?
>                  1, 2, 1
>
> It should've returned 0,0,0.
>
> Now, trying to express a vector, w, in terms of the new basis {v1,v2,v3}
> also runs into problem:
>
> (16) -> w : VF := [2,3,10]
>
>    (16)  [2, 3, 10]
>
> (17) -> coordinatesIfCan(w,[v1,v2,v3])
>    There are no exposed library operations named coordinatesIfCan but 
>       there is one unexposed operation with that name. Use HyperDoc 
>       Browse or issue
>                         )display op coordinatesIfCan
>       to learn more about the available operation.
>  
>    Cannot find a definition or applicable library operation named 
>       coordinatesIfCan with argument type(s) 
>                            Vector(PrimeField(11))
>                         List(Vector(PrimeField(11)))
>       
>       Perhaps you should use "@" to indicate the required return type, 
>       or "$" to specify which version of the function you need.
>
> Are the two functions applied the wrong way in the above cases?
>
> Thanks,
> SWA
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "FriCAS - computer algebra system" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/fricas-devel/eb43990c-c999-476d-b81e-5888a43066dan%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/fricas-devel/eb43990c-c999-476d-b81e-5888a43066dan%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> -- 
> Mit freundlichen Grüßen
>
> Johannes Grabmeier
>
> Prof. Dr. Johannes Grabmeier, 
> Köckstraße 1, D-94469 Deggendorf
> Tel. +49-(0)-991-2979584 <+49%20991%202979584>, Tel. +49-(0)-151-681-70756 
> <+49%201516%208170756>
> Fax: +49-(0)-991-2979592 <+49%20991%202979592>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/d157f6a4-6e2c-4b35-a2e5-245b16ceca74n%40googlegroups.com.

Reply via email to