ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 15 Mar 2018 12:46:20 +0100differential form to vector field and backhttps://ask.sagemath.org/question/40801/differential-form-to-vector-field-and-back/Is there a way to convert a vector field into a corresponding differential 1-form (work form) or a corresponding differential 2-form (flow form)?
And vice versa, is there a way to convert a 1-form or a 2-form into a corresponding vector field?
Thanks.Sat, 27 Jan 2018 12:46:21 +0100https://ask.sagemath.org/question/40801/differential-form-to-vector-field-and-back/Answer by eric_g for <p>Is there a way to convert a vector field into a corresponding differential 1-form (work form) or a corresponding differential 2-form (flow form)?</p>
<p>And vice versa, is there a way to convert a 1-form or a 2-form into a corresponding vector field?</p>
<p>Thanks.</p>
https://ask.sagemath.org/question/40801/differential-form-to-vector-field-and-back/?answer=40804#post-id-40804Yes, but you need a metric for this. If the metric is `g`, then to transform a vector field `v` into a 1-form, it suffices to write
v.down(g)
while to transform a 1-form `f` into a vector field, the command is
f.up(g)
More details in [this section](http://doc.sagemath.org/html/en/reference/manifolds/sage/manifolds/differentiable/tensorfield.html#sage.manifolds.differentiable.tensorfield.TensorField.down) of the reference manual.
Sat, 27 Jan 2018 14:28:11 +0100https://ask.sagemath.org/question/40801/differential-form-to-vector-field-and-back/?answer=40804#post-id-40804Comment by danielvolinski for <p>Yes, but you need a metric for this. If the metric is <code>g</code>, then to transform a vector field <code>v</code> into a 1-form, it suffices to write</p>
<pre><code>v.down(g)
</code></pre>
<p>while to transform a 1-form <code>f</code> into a vector field, the command is</p>
<pre><code>f.up(g)
</code></pre>
<p>More details in <a href="http://doc.sagemath.org/html/en/reference/manifolds/sage/manifolds/differentiable/tensorfield.html#sage.manifolds.differentiable.tensorfield.TensorField.down">this section</a> of the reference manual.</p>
https://ask.sagemath.org/question/40801/differential-form-to-vector-field-and-back/?comment=41558#post-id-41558Thanks EricThu, 15 Mar 2018 12:46:20 +0100https://ask.sagemath.org/question/40801/differential-form-to-vector-field-and-back/?comment=41558#post-id-41558Comment by danielvolinski for <p>Yes, but you need a metric for this. If the metric is <code>g</code>, then to transform a vector field <code>v</code> into a 1-form, it suffices to write</p>
<pre><code>v.down(g)
</code></pre>
<p>while to transform a 1-form <code>f</code> into a vector field, the command is</p>
<pre><code>f.up(g)
</code></pre>
<p>More details in <a href="http://doc.sagemath.org/html/en/reference/manifolds/sage/manifolds/differentiable/tensorfield.html#sage.manifolds.differentiable.tensorfield.TensorField.down">this section</a> of the reference manual.</p>
https://ask.sagemath.org/question/40801/differential-form-to-vector-field-and-back/?comment=40816#post-id-40816Thanks Eric.
What about the flux form .i.e. converting a vector field into its corresponding 2-form and back?
As you mentioned above, this depends on the metric `g
DanielSat, 27 Jan 2018 21:57:42 +0100https://ask.sagemath.org/question/40801/differential-form-to-vector-field-and-back/?comment=40816#post-id-40816Comment by eric_g for <p>Yes, but you need a metric for this. If the metric is <code>g</code>, then to transform a vector field <code>v</code> into a 1-form, it suffices to write</p>
<pre><code>v.down(g)
</code></pre>
<p>while to transform a 1-form <code>f</code> into a vector field, the command is</p>
<pre><code>f.up(g)
</code></pre>
<p>More details in <a href="http://doc.sagemath.org/html/en/reference/manifolds/sage/manifolds/differentiable/tensorfield.html#sage.manifolds.differentiable.tensorfield.TensorField.down">this section</a> of the reference manual.</p>
https://ask.sagemath.org/question/40801/differential-form-to-vector-field-and-back/?comment=40817#post-id-40817In dimension 3, you can get the flux 2-form as the Hodge dual of the 1-form associated to the vector:
v.down(g).hodge_dual(g)
More details [here](http://doc.sagemath.org/html/en/reference/manifolds/sage/manifolds/differentiable/diff_form.html#sage.manifolds.differentiable.diff_form.DiffForm.hodge_dual).Sat, 27 Jan 2018 23:42:55 +0100https://ask.sagemath.org/question/40801/differential-form-to-vector-field-and-back/?comment=40817#post-id-40817