Skip to content

error setting scalar component X.set_coef(0, 0, value) #222

@chriswebers

Description

@chriswebers

The scalar component of a multi-vector can not be set with
X.set_coef(igrade=0, ibase, value)
for any value of ibase .
Reason: The first element of self.Ga.blades or self.Ga.bases is the empty list [].
Any index ibase into this empty list will throw an error.

Example code:

x = 1 + a1 + a2 + a1*a2
x.set_coef(0, 0, 42)

/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/galgebra/mv.py in set_coef(self, igrade, ibase, value)
   1174     def set_coef(self, igrade, ibase, value):
   1175         if self.blade_rep:
-> 1176             base = self.Ga.blades[igrade][ibase]
   1177         else:
   1178             base = self.Ga.bases[igrade][ibase]

IndexError: list index out of range

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions