Hey folks,
I'm pretty new to this, so please be patient.

During my developement of an implementation of characteristic classes of 
the tangent bdl of manifolds, I've encountered a problem when wedging 
unnamed differential forms on non-parallelizable manifolds. Let's have an 
example:

sage: S2 = Manifold(2, name='S2', latex_name=r'S^2', start_index=1)
sage: U = S2.open_subset(name='U', latex_name=r'S^2 \setminus \{\text{South 
pole}\}')
sage: V = S2.open_subset(name='V', latex_name=r'S^2 \setminus \{\text{North 
pole}\}')
sage: S2.declare_union(U,V)
sage: c_xy.<t,z> = U.chart()
sage: c_uv.<u,v> = V.chart()
sage: xy_to_uv = c_xy.transition_map(c_uv, (x/(x^2+y^2), y/(x^2+y^2)),
                               intersection_name='W', restrictions1= x^2+y^2
!=0,
                               restrictions2= u^2+v^2!=0)
sage: uv_to_xy = xy_to_uv.inverse()
sage: e_tz = c_tz.frame()
sage: e_uv = c_uv.frame(); print(e_uv)

sage: omega = S2.diff_form(1, name='omega', latex_name=r'\omega')
sage: unnamed = S2.diff_form(1)

sage: omega[e_xy,:] = -x^2, y^2; show(omega.disp(e_tz))
sage: omega.add_comp_by_continuation(e_uv, V.intersection(U), c_uv)

sage: unnamed[e_xy,:] = -x^2, y^2; show(omega.disp(e_tz))
sage: unnamed.add_comp_by_continuation(e_uv, V.intersection(U), c_uv)

sage: unnamed.wedge(omega)

---------------------------------------------------------------------------UnboundLocalError
                         Traceback (most recent call 
last)<ipython-input-40-a6a98dadea76> in <module>()----> 1 unnamed.wedge(omega)
/opt/sagemath-8.6/local/lib/python2.7/site-packages/sage/manifolds/differentiable/diff_form.pyc
 in wedge(self, other)    520         vmodule = 
dom_resu.vector_field_module(dest_map=dest_map_resu)    521         resu_degree 
= self._tensor_rank + other._tensor_rank--> 522         resu = 
vmodule.alternating_form(resu_degree, name=resu_name,    523                    
                     latex_name=resu_latex_name)    524         for dom in 
self_r._restrictions:
UnboundLocalError: local variable 'resu_name' referenced before assignment

Unfortunately, I'm not a professional in python, but I guess the problem could 
be solved by declaring resu_name and resu_latex_name in the wedge method of the 
manifolds/differentiable/tensorfield.py file as "None" in the very beginning. 
In fact, solving this is crucial for calculations with mixed differential forms 
and its matrices in order to compute the characteristic classes.

What is the next step? Create a ticket?

Also, I like to discuss my developement so far. But that might be better for 
another thread.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to