question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

array of multivectors fails

See original GitHub issue

@rkern or @moble, do either of you know why this happens?

import numpy as np
from clifford import Cl 
layout,blades = Cl(2) # note i changed firstIdx=1 by default in Cl
locals().update(blades)

np.array([e1,e2],dtype=np.object) 

yields

array([[0, 1, 0, 0],
       [0, 0, 1, 0]], dtype=object)

perhaps there are some special array-like methods that Multivector implements? is there a way to have an array of multivectors, instead of an array of their values?

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
eric-wiesercommented, Mar 29, 2019

The big problem with __array_wrap__ is it runs after numpy has already done the computation. If you’re going to just do your own computation, you should use __array_ufunc__.

But if you’re not trying to be an array at all, then telling numpy how to turn yourself into one is sufficient.

0reactions
arsenoviccommented, Mar 30, 2019

thanks for the definitive reply!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Generalizing the dot product to multivectors
My error: The problem cannot be solved at this point in the book. ... The dot product of a multivector is typically defined...
Read more >
Epetra: Epetra_MultiVector Class Reference - Index of /
Contains the array of pointers containing the multivector data. Returns: Integer error code, set to 0 if successful, -1 if the multivector was...
Read more >
Classes — Clifford 0.82 documentation - Read the Docs
Two classes, Layout and MultiVector, and several helper functions are ... iff M*~M == |M|**2] fails for those multivectors where M*~M is not...
Read more >
Symbolic computation fails due to += dispatch · Issue #34 ... - GitHub
Am I wrong or is it a bug ? using Reduce using Grassmann @basis S"∞∅+++" p = :x*v1 + :y*v2 + :z*v3 P...
Read more >
Boost.MultiArray Reference Manual - 1.48.0
A . element, This is the type of objects stored at the base of the hierarchy of MultiArrays. It is the same as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found