# Numbered symbols

I work with an exterior algebra over $R^n$. I have the basis $\{1,\omega_i\}_{i=1}^n$ in this algebra, and my differential operator is defined as

$$d\omega_k=\sum_{i>j>0,i+j=k} (i-j)w_i\wedge w_j.$$

As you see, my sum depends directly on the indexes of the elements of the basis. I surely can define the wedge and the differential operator in Mathematica, and they will calculate the derivative for any polynome I want. My problem is to find a good way to describe the elements of the basis, which will permit me use these formulas easily. It can not be just the integers $1, .. n$ for every element $\omega_1, .. \omega_n$, because Mathematica will multiply them as normal numbers, not treating them as elements of the exterior algebra; it cannot be just symbols such as `w1`, `w2`, ... because I cannot easily extract the numbers from them to calculate the derivatives (or I just don't know how).

I tried to represent them with `{1}`, `{2}`, and so on. I also used noncommutative multiplication with additional relations as the exterior multiplication. Example of what my notebook can calculate:

````In[30]:= d[{5} ** {4}]
Out[30]= {4} ** {3} ** {2} + 2 {5} ** {3} ** {1}
````

That's nice. I defined multiplication and differentiation without problems, except for one small thing -- multiplying by a scalar. For example, consider the expression $2\omega_4+\omega_5$. In this notation it appears as `2 {4} + {5}`. Mathematica proceeds to `{8} + {5}` and then to `{13}`, which is completely wrong.

````In[31]:= 2 {4} + {5}
Out[31]= {13}  
````

This only happens when working with dimension 1. For higher grades everything's fine because Mathematica's multiplication doesn't misbehave when working with non-commutative elements:

````In[32]:= 2 {4} ** {3} + 6 {5} ** {2}
Out[32]= 2 {4} ** {3} + 6 {5} ** {2}

In[33]:= (2 {4} ** {3} + 6 {5} ** {2}) ** {3}
Out[33]= -6 {5} ** {3} ** {2}  
````

But this is still not what I want -- lower dimensions are important to me, so my question is: how do I represent the basis elements without these problems? I can try to partially clear `Times`, but I don't think this is best way, as the multiplication of lists may be vital later in the code.

-

3
Why not w@1 ... w@n ? – belisarius Jan 2 at 18:36
The answer by helen to Differential geometry add-ons for Mathematica describes how Atlas 2 can handle this - but that's a commercial product and I can understand if you want to build your own version. However, maybe you can find some useful ideas in that link. – Jens Jan 2 at 18:37
@belisarius Thanks a lot, this works fine. – kriokamera Jan 2 at 18:46

1
Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Read the faq! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign!. And please,change your userid to something easier to remember! – belisarius Jan 2 at 18:56

## 1 Answer

Just do

````lst = w /@ Range[10]
(*{w[1], w[2], w[3], w[4], w[5], w[6], w[7], w[8], w[9], w[10]}*)
````

You can extract indices like this

````lst /. w[n_] :> n
(*{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}*)
````

(this works on each element, so eg `w[3] /. w[n_] :> n` evaluates to `3` and so on).

-
lang-mma
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 5, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.903971791267395, "perplexity_flag": "middle"}