Bundle Connections - Manifolds

Skip to content
Back to top
View this page
Edit this page

# Bundle Connections

Let \(E \to M\) be a smooth vector bundle of rank \(n\) over a smooth manifold \(M\) and over a non-discrete topological field \(K\) (typically \(K=\RR\) or \(K=\CC\)). A bundle connection on this vector bundle is a \(K\)-linear map

\[\nabla : C^\infty(M;E) \to C^\infty(M;E \otimes T^*M)\]

such that the Leibniz rule applies for each scalar field \(f \in C^\infty(M)\) and section \(s \in C^\infty(M;E)\):

\[\nabla(f \, s) = f \cdot \nabla s + s \otimes \mathrm{d}f .\]

If \(e\) is a local frame on \(E\), we have

\[\nabla e_i = \sum^n_{j=1} e_j \otimes \omega^j_i ,\]

and the corresponding \(n \times n\)-matrix \((\omega^j_i)_{i,j}\) consisting of one forms is called connection matrix of \(\nabla\) with respect to \(e\).

AUTHORS:

- Michael Jung (2019) : initial version

class sage.manifolds.differentiable.bundle_connection.BundleConnection(vbundle, name, latex_name=None)

  Bases: `SageObject`, `Mutability`

  An instance of this class represents a bundle connection \(\nabla\) on a smooth vector bundle \(E \to M\).

  INPUT:

  - `vbundle` – the vector bundle on which the connection is defined (must be an instance of class `DifferentiableVectorBundle`)

  - `name` – name given to the bundle connection

  - `latex_name` – (default: `None`) LaTeX symbol to denote the bundle connection; if `None`, it is set to `name`

  EXAMPLES:

  Define a bundle connection on a rank 2 vector bundle over some 3-dimensional smooth manifold:

  Sage

      sage: M = Manifold(3, 'M', start_index=1)
      sage: X.<x,y,z> = M.chart()
      sage: E = M.vector_bundle(2, 'E')
      sage: e = E.local_frame('e') # standard frame for E
      sage: nab = E.bundle_connection('nabla'); nab
      Bundle connection nabla on the Differentiable real vector bundle E -> M
       of rank 2 over the base space 3-dimensional differentiable manifold M

  Python

      >>> from sage.all import *
      >>> M = Manifold(Integer(3), 'M', start_index=Integer(1))
      >>> X = M.chart(names=('x', 'y', 'z',)); (x, y, z,) = X._first_ngens(3)
      >>> E = M.vector_bundle(Integer(2), 'E')
      >>> e = E.local_frame('e') # standard frame for E
      >>> nab = E.bundle_connection('nabla'); nab
      Bundle connection nabla on the Differentiable real vector bundle E -> M
       of rank 2 over the base space 3-dimensional differentiable manifold M

  First, let us initialize all connection 1-forms w.r.t. the frame `e` to zero:

  Sage

      sage: nab[e, :] = [[0, 0], [0, 0]]

  [Python]

      >>> from sage.all import *
      >>> nab[e, :] = [[Integer(0), Integer(0)], [Integer(0), Integer(0)]]

  This line can be shortened by the following:

  Sage

      sage: nab[e, :] = 0  # initialize to zero

  Python

      >>> from sage.all import *
      >>> nab[e, :] = Integer(0)  # initialize to zero

  The connection 1-forms are now initialized being differential 1-forms:

  Sage

      sage: nab[e, 1, 1].parent()
      Free module Omega^1(M) of 1-forms on the 3-dimensional differentiable
       manifold M
      sage: nab[e, 1, 1].display()
      connection (1,1) of bundle connection nabla w.r.t. Local frame
       (E|_M, (e_1,e_2)) = 0

  [Python]

      >>> from sage.all import *
      >>> nab[e, Integer(1), Integer(1)].parent()
      Free module Omega^1(M) of 1-forms on the 3-dimensional differentiable
       manifold M
      >>> nab[e, Integer(1), Integer(1)].display()
      connection (1,1) of bundle connection nabla w.r.t. Local frame
       (E|_M, (e_1,e_2)) = 0

  Now, we want to specify some nonzero entries:

  Sage

      sage: nab[e, 1, 2][:] = [x*z, y*z, z^2]
      sage: nab[e, 2, 1][:] = [x, x^2, x^3]
      sage: nab[e, 1, 1][:] = [x+z, y-z, x*y*z]
      sage: nab.display()
      connection (1,1) of bundle connection nabla w.r.t. Local frame
       (E|_M, (e_1,e_2)) = (x + z) dx + (y - z) dy + x*y*z dz
      connection (1,2) of bundle connection nabla w.r.t. Local frame
       (E|_M, (e_1,e_2)) = x*z dx + y*z dy + z^2 dz
      connection (2,1) of bundle connection nabla w.r.t. Local frame
       (E|_M, (e_1,e_2)) = x dx + x^2 dy + x^3 dz

  Python

      >>> from sage.all import *
      >>> nab[e, Integer(1), Integer(2)][:] = [x*z, y*z, z**Integer(2)]
      >>> nab[e, Integer(2), Integer(1)][:] = [x, x**Integer(2), x**Integer(3)]
      >>> nab[e, Integer(1), Integer(1)][:] = [x+z, y-z, x*y*z]
      >>> nab.display()
      connection (1,1) of bundle connection nabla w.r.t. Local frame
       (E|_M, (e_1,e_2)) = (x + z) dx + (y - z) dy + x*y*z dz
      connection (1,2) of bundle connection nabla w.r.t. Local frame
       (E|_M, (e_1,e_2)) = x*z dx + y*z dy + z^2 dz
      connection (2,1) of bundle connection nabla w.r.t. Local frame
       (E|_M, (e_1,e_2)) = x dx + x^2 dy + x^3 dz

  Notice, when we omit the frame, the default frame of the vector bundle is assumed (in this case `e`):

  Sage

      sage: nab[2, 2].display()
      connection (2,2) of bundle connection nabla w.r.t. Local frame
       (E|_M, (e_1,e_2)) = 0

  [Python]

      >>> from sage.all import *
      >>> nab[Integer(2), Integer(2)].display()
      connection (2,2) of bundle connection nabla w.r.t. Local frame
       (E|_M, (e_1,e_2)) = 0

  The same holds for the assignment:

  Sage

      sage: nab[1, 2] = 0
      sage: nab[e, 1, 2].display()
      connection (1,2) of bundle connection nabla w.r.t. Local frame
       (E|_M, (e_1,e_2)) = 0

  Python

      >>> from sage.all import *
      >>> nab[Integer(1), Integer(2)] = Integer(0)
      >>> nab[e, Integer(1), Integer(2)].display()
      connection (1,2) of bundle connection nabla w.r.t. Local frame
       (E|_M, (e_1,e_2)) = 0

  Keep noticed that item assignments for bundle connections only copy the right-hand-side and never create a binding to the original instance:

  Sage

      sage: omega = M.one_form('omega')
      sage: omega[:] = [x*z, y*z, z^2]
      sage: nab[1, 2] = omega
      sage: nab[1, 2] == omega
      True
      sage: nab[1, 2] is omega
      False

  [Python]

      >>> from sage.all import *
      >>> omega = M.one_form('omega')
      >>> omega[:] = [x*z, y*z, z**Integer(2)]
      >>> nab[Integer(1), Integer(2)] = omega
      >>> nab[Integer(1), Integer(2)] == omega
      True
      >>> nab[Integer(1), Integer(2)] is omega
      False

  Hence, this is therefore equivalent to:

  Sage

      sage: nab[2, 2].copy_from(omega)

  Python

      >>> from sage.all import *
      >>> nab[Integer(2), Integer(2)].copy_from(omega)

  Preferably, we use `set_connection_form()` to specify the connection 1-forms:

  Sage

      sage: nab[:] = 0  # re-initialize to zero
      sage: nab.set_connection_form(1, 2)[:] = [x*z, y*z, z^2]
      sage: nab.set_connection_form(2, 1)[:] = [x, x^2, x^3]
      sage: nab[1, 2].display()
      connection (1,2) of bundle connection nabla w.r.t. Local frame
       (E|_M, (e_1,e_2)) = x*z dx + y*z dy + z^2 dz
      sage: nab[2, 1].display()
      connection (2,1) of bundle connection nabla w.r.t. Local frame
       (E|_M, (e_1,e_2)) = x dx + x^2 dy + x^3 dz

  [Python]

      >>> from sage.all import *
      >>> nab[:] = Integer(0)  # re-initialize to zero
      >>> nab.set_connection_form(Integer(1), Integer(2))[:] = [x*z, y*z, z**Integer(2)]
      >>> nab.set_connection_form(Integer(2), Integer(1))[:] = [x, x**Integer(2), x**Integer(3)]
      >>> nab[Integer(1), Integer(2)].display()
      connection (1,2) of bundle connection nabla w.r.t. Local frame
       (E|_M, (e_1,e_2)) = x*z dx + y*z dy + z^2 dz
      >>> nab[Integer(2), Integer(1)].display()
      connection (2,1) of bundle connection nabla w.r.t. Local frame
       (E|_M, (e_1,e_2)) = x dx + x^2 dy + x^3 dz

  Note

  Notice that item assignments and `set_connection_form()` delete the connection 1-forms w.r.t. other frames for consistency reasons. To avoid this behavior, `add_connection_form()` must be used instead.

  In conclusion, the connection 1-forms of a bundle connection are mutable until the connection itself is set immutable:

  Sage

      sage: nab.set_immutable()
      sage: nab[1, 2] = omega
      Traceback (most recent call last):
      ...
      ValueError: object is immutable; please change a copy instead

  Python

      >>> from sage.all import *
      >>> nab.set_immutable()
      >>> nab[Integer(1), Integer(2)] = omega
      Traceback (most recent call last):
      ...
      ValueError: object is immutable; please change a copy instead

  By definition, a bundle connection acts on vector fields and sections:

  Sage

      sage: v = M.vector_field((x^2,y^2,z^2), name='v'); v.display()
      v = x^2 ∂/∂x + y^2 ∂/∂y + z^2 ∂/∂z
      sage: s = E.section((x-y^2, -z), name='s'); s.display()
      s = (-y^2 + x) e_1 - z e_2
      sage: nab_vs = nab(v, s); nab_vs
      Section nabla_v(s) on the 3-dimensional differentiable manifold M with
       values in the real vector bundle E of rank 2
      sage: nab_vs.display()
      nabla_v(s) = (-x^3*z^3 - 2*y^3 + x^2 - (x^2*y^2 + x^3)*z) e_1 +
       (-(y^2 - x)*z^4 - (x^3*y^2 + y^5 - x^4 - x*y^3)*z - z^2) e_2

  [Python]

      >>> from sage.all import *
      >>> v = M.vector_field((x**Integer(2),y**Integer(2),z**Integer(2)), name='v'); v.display()
      v = x^2 ∂/∂x + y^2 ∂/∂y + z^2 ∂/∂z
      >>> s = E.section((x-y**Integer(2), -z), name='s'); s.display()
      s = (-y^2 + x) e_1 - z e_2
      >>> nab_vs = nab(v, s); nab_vs
      Section nabla_v(s) on the 3-dimensional differentiable manifold M with
       values in the real vector bundle E of rank 2
      >>> nab_vs.display()
      nabla_v(s) = (-x^3*z^3 - 2*y^3 + x^2 - (x^2*y^2 + x^3)*z) e_1 +
       (-(y^2 - x)*z^4 - (x^3*y^2 + y^5 - x^4 - x*y^3)*z - z^2) e_2

  The bundle connection action certainly obeys the defining formula for the connection 1-forms:

  Sage

      sage: vframe = X.frame()
      sage: all(nab(vframe[k], e[i]) == sum(nab[e, i, j](vframe[k])*e[j]
      ....:                                 for j in E.irange())
      ....:     for i in E.irange() for k in M.irange())
      True

  Python

      >>> from sage.all import *
      >>> vframe = X.frame()
      >>> all(nab(vframe[k], e[i]) == sum(nab[e, i, j](vframe[k])*e[j]
      ...                                 for j in E.irange())
      ...     for i in E.irange() for k in M.irange())
      True

  The connection 1-forms are computed automatically for different frames:

  Sage

      sage: f = E.local_frame('f', ((1+x^2)*e[1], e[1]-e[2]))
      sage: nab.display(frame=f)
      connection (1,1) of bundle connection nabla w.r.t. Local frame
       (E|_M, (f_1,f_2)) = ((x^3 + x)*z + 2*x)/(x^2 + 1) dx + y*z dy + z^2 dz
      connection (1,2) of bundle connection nabla w.r.t. Local frame
       (E|_M, (f_1,f_2)) = -(x^3 + x)*z dx - (x^2 + 1)*y*z dy -
        (x^2 + 1)*z^2 dz
      connection (2,1) of bundle connection nabla w.r.t. Local frame
       (E|_M, (f_1,f_2)) = (x*z - x)/(x^2 + 1) dx -
        (x^2 - y*z)/(x^2 + 1) dy - (x^3 - z^2)/(x^2 + 1) dz
      connection (2,2) of bundle connection nabla w.r.t. Local frame
       (E|_M, (f_1,f_2)) = -x*z dx - y*z dy - z^2 dz

  [Python]

      >>> from sage.all import *
      >>> f = E.local_frame('f', ((Integer(1)+x**Integer(2))*e[Integer(1)], e[Integer(1)]-e[Integer(2)]))
      >>> nab.display(frame=f)
      connection (1,1) of bundle connection nabla w.r.t. Local frame
       (E|_M, (f_1,f_2)) = ((x^3 + x)*z + 2*x)/(x^2 + 1) dx + y*z dy + z^2 dz
      connection (1,2) of bundle connection nabla w.r.t. Local frame
       (E|_M, (f_1,f_2)) = -(x^3 + x)*z dx - (x^2 + 1)*y*z dy -
        (x^2 + 1)*z^2 dz
      connection (2,1) of bundle connection nabla w.r.t. Local frame
       (E|_M, (f_1,f_2)) = (x*z - x)/(x^2 + 1) dx -
        (x^2 - y*z)/(x^2 + 1) dy - (x^3 - z^2)/(x^2 + 1) dz
      connection (2,2) of bundle connection nabla w.r.t. Local frame
       (E|_M, (f_1,f_2)) = -x*z dx - y*z dy - z^2 dz

  The new connection 1-forms obey the defining formula, too:

  Sage

      sage: all(nab(vframe[k], f[i]) == sum(nab[f, i, j](vframe[k])*f[j]
      ....:                                 for j in E.irange())
      ....:     for i in E.irange() for k in M.irange())
      True

  Python

      >>> from sage.all import *
      >>> all(nab(vframe[k], f[i]) == sum(nab[f, i, j](vframe[k])*f[j]
      ...                                 for j in E.irange())
      ...     for i in E.irange() for k in M.irange())
      True

  After the connection has been specified, the curvature 2-forms can be derived:

  Sage

      sage: Omega = nab.curvature_form
      sage: for i in E.irange():
      ....:     for j in E.irange():
      ....:         print(Omega(i ,j, e).display())
      curvature (1,1) of bundle connection nabla w.r.t. Local frame
       (E|_M, (e_1,e_2)) = -(x^3 - x*y)*z dx∧dy + (-x^4*z + x*z^2) dx∧dz +
        (-x^3*y*z + x^2*z^2) dy∧dz
      curvature (1,2) of bundle connection nabla w.r.t. Local frame
       (E|_M, (e_1,e_2)) = -x dx∧dz - y dy∧dz
      curvature (2,1) of bundle connection nabla w.r.t. Local frame
       (E|_M, (e_1,e_2)) = 2*x dx∧dy + 3*x^2 dx∧dz
      curvature (2,2) of bundle connection nabla w.r.t. Local frame
       (E|_M, (e_1,e_2)) = (x^3 - x*y)*z dx∧dy + (x^4*z - x*z^2) dx∧dz +
        (x^3*y*z - x^2*z^2) dy∧dz

  [Python]

      >>> from sage.all import *
      >>> Omega = nab.curvature_form
      >>> for i in E.irange():
      ...     for j in E.irange():
      ...         print(Omega(i ,j, e).display())
      curvature (1,1) of bundle connection nabla w.r.t. Local frame
       (E|_M, (e_1,e_2)) = -(x^3 - x*y)*z dx∧dy + (-x^4*z + x*z^2) dx∧dz +
        (-x^3*y*z + x^2*z^2) dy∧dz
      curvature (1,2) of bundle connection nabla w.r.t. Local frame
       (E|_M, (e_1,e_2)) = -x dx∧dz - y dy∧dz
      curvature (2,1) of bundle connection nabla w.r.t. Local frame
       (E|_M, (e_1,e_2)) = 2*x dx∧dy + 3*x^2 dx∧dz
      curvature (2,2) of bundle connection nabla w.r.t. Local frame
       (E|_M, (e_1,e_2)) = (x^3 - x*y)*z dx∧dy + (x^4*z - x*z^2) dx∧dz +
        (x^3*y*z - x^2*z^2) dy∧dz

  The derived forms certainly obey the structure equations, see `curvature_form()` for details:

  Sage

      sage: omega = nab.connection_form
      sage: check = []
      sage: for i in E.irange():  # long time
      ....:     for j in E.irange():
      ....:         check.append(Omega(i,j,e) == \
      ....:                       omega(i,j,e).exterior_derivative() + \
      ....:         sum(omega(k,j,e).wedge(omega(i,k,e))
      ....:             for k in E.irange()))
      sage: check  # long time
      [True, True, True, True]

  Python

      >>> from sage.all import *
      >>> omega = nab.connection_form
      >>> check = []
      >>> for i in E.irange():  # long time
      ...     for j in E.irange():
      ...         check.append(Omega(i,j,e) ==                       omega(i,j,e).exterior_derivative() +         sum(omega(k,j,e).wedge(omega(i,k,e))
      ...             for k in E.irange()))
      >>> check  # long time
      [True, True, True, True]

  add_connection_form(i, j, frame=None)

    Return the connection form \(\omega^j_i\) in a given frame for assignment.

    See method `connection_forms()` for details about the definition of the connection forms.

    To delete the connection forms in other frames, use the method `set_connection_form()` instead.

    INPUT:

    - `i`, `j` – indices identifying the 1-form \(\omega^j_i\)

    - `frame` – (default: `None`) local frame in which the connection 1-form is defined; if `None`, the default frame of the vector bundle is assumed.

    Warning

    If the connection has already forms in other frames, it is the user’s responsibility to make sure that the 1-forms to be added are consistent with them.

    OUTPUT:

    - connection 1-form \(\omega^j_i\) in the given frame, as an instance of the class `DiffForm`; if such connection 1-form did not exist previously, it is created. See method `connection_forms()` for the storage convention of the connection 1-forms.

    EXAMPLES:

    Sage

        sage: M = Manifold(2, 'M')
        sage: X.<x,y> = M.chart()
        sage: E = M.vector_bundle(2, 'E')
        sage: e = E.local_frame('e') # standard frame for E
        sage: nab = E.bundle_connection('nabla', latex_name=r'\nabla')
        sage: nab.add_connection_form(0, 1, frame=e)[:] = [x^2, x]
        sage: nab[e, 0, 1].display()
        connection (0,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_0,e_1)) = x^2 dx + x dy

    Python

        >>> from sage.all import *
        >>> M = Manifold(Integer(2), 'M')
        >>> X = M.chart(names=('x', 'y',)); (x, y,) = X._first_ngens(2)
        >>> E = M.vector_bundle(Integer(2), 'E')
        >>> e = E.local_frame('e') # standard frame for E
        >>> nab = E.bundle_connection('nabla', latex_name=r'\nabla')
        >>> nab.add_connection_form(Integer(0), Integer(1), frame=e)[:] = [x**Integer(2), x]
        >>> nab[e, Integer(0), Integer(1)].display()
        connection (0,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_0,e_1)) = x^2 dx + x dy

    Since `e` is the vector bundle’s default local frame, its mention may be omitted:

    Sage

        sage: nab.add_connection_form(1, 0)[:] = [y^2, y]
        sage: nab[1, 0].display()
        connection (1,0) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_0,e_1)) = y^2 dx + y dy

    [Python]

        >>> from sage.all import *
        >>> nab.add_connection_form(Integer(1), Integer(0))[:] = [y**Integer(2), y]
        >>> nab[Integer(1), Integer(0)].display()
        connection (1,0) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_0,e_1)) = y^2 dx + y dy

    Adding connection 1-forms w.r.t. to another local frame:

    Sage

        sage: f = E.local_frame('f')
        sage: nab.add_connection_form(1, 1, frame=f)[:] = [x, y]
        sage: nab[f, 1, 1].display()
        connection (1,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (f_0,f_1)) = x dx + y dy

    Python

        >>> from sage.all import *
        >>> f = E.local_frame('f')
        >>> nab.add_connection_form(Integer(1), Integer(1), frame=f)[:] = [x, y]
        >>> nab[f, Integer(1), Integer(1)].display()
        connection (1,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (f_0,f_1)) = x dx + y dy

    The forms w.r.t. the frame `e` have been kept:

    Sage

        sage: nab[e, 0, 1].display()
        connection (0,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_0,e_1)) = x^2 dx + x dy

    [Python]

        >>> from sage.all import *
        >>> nab[e, Integer(0), Integer(1)].display()
        connection (0,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_0,e_1)) = x^2 dx + x dy

    To delete them, use the method `set_connection_form()` instead.

  connection_form(i, j, frame=None)

    Return the connection 1-form corresponding to the given index and local frame.

    See also

    Consult `connection_forms()` for detailed information.

    INPUT:

    - `i`, `j` – indices identifying the 1-form \(\omega^j_i\)

    - `frame` – (default: `None`) local frame relative to which the connection 1-forms are defined; if `None`, the default frame of the vector bundle’s corresponding section module is assumed.

    OUTPUT:

    - the 1-form \(\omega^j_i\), as an instance of `DiffForm`

    EXAMPLES:

    Sage

        sage: M = Manifold(2, 'M')
        sage: X.<x,y> = M.chart()
        sage: E = M.vector_bundle(2, 'E')
        sage: e = E.local_frame('e') # standard frame for E
        sage: nab = E.bundle_connection('nabla', latex_name=r'\nabla')
        sage: nab.set_connection_form(0, 1)[:] = [x^2, x]
        sage: nab.set_connection_form(1, 0)[:] = [y^2, y]
        sage: nab.connection_form(0, 1).display()
        connection (0,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_0,e_1)) = x^2 dx + x dy
        sage: nab.connection_form(1, 0).display()
        connection (1,0) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_0,e_1)) = y^2 dx + y dy

    Python

        >>> from sage.all import *
        >>> M = Manifold(Integer(2), 'M')
        >>> X = M.chart(names=('x', 'y',)); (x, y,) = X._first_ngens(2)
        >>> E = M.vector_bundle(Integer(2), 'E')
        >>> e = E.local_frame('e') # standard frame for E
        >>> nab = E.bundle_connection('nabla', latex_name=r'\nabla')
        >>> nab.set_connection_form(Integer(0), Integer(1))[:] = [x**Integer(2), x]
        >>> nab.set_connection_form(Integer(1), Integer(0))[:] = [y**Integer(2), y]
        >>> nab.connection_form(Integer(0), Integer(1)).display()
        connection (0,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_0,e_1)) = x^2 dx + x dy
        >>> nab.connection_form(Integer(1), Integer(0)).display()
        connection (1,0) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_0,e_1)) = y^2 dx + y dy

  connection_forms(frame=None)

    Return the connection forms relative to the given frame.

    If \(e\) is a local frame on \(E\), we have

    \[\nabla e_i = \sum^n_{j=1} e_j \otimes \omega^j_i ,\]

    and the corresponding \(n \times n\)-matrix \((\omega^j_i)_{i,j}\) consisting of one forms is called connection matrix of \(\nabla\) with respect to \(e\).

    If the connection coefficients are not known already, they are computed from the above formula.

    INPUT:

    - `frame` – (default: `None`) local frame relative to which the connection forms are required; if none is provided, the vector bundle’s default frame is assumed

    OUTPUT:

    - connection forms relative to the frame `frame`, as a dictionary with tuples \((i, j)\) as key and one forms as instances of `diff_form` as value representing the matrix entries.

    EXAMPLES:

    Connection forms of a bundle connection on a rank 2 vector bundle over a 3-dimensional manifold:

    Sage

        sage: M = Manifold(3, 'M', start_index=1)
        sage: c_xyz.<x,y,z> = M.chart()
        sage: E = M.vector_bundle(2, 'E')
        sage: e = E.local_frame('e')
        sage: nab = E.bundle_connection('nabla', r'\nabla')
        sage: nab[:] = 0  # initialize curvature forms
        sage: forms = nab.connection_forms()
        sage: [forms[k] for k in sorted(forms)]
        [1-form connection (1,1) of bundle connection nabla w.r.t. Local
         frame (E|_M, (e_1,e_2)) on the 3-dimensional differentiable
         manifold M,
        1-form connection (1,2) of bundle connection nabla w.r.t. Local
         frame (E|_M, (e_1,e_2)) on the 3-dimensional differentiable
         manifold M,
        1-form connection (2,1) of bundle connection nabla w.r.t. Local
         frame (E|_M, (e_1,e_2)) on the 3-dimensional differentiable
         manifold M,
        1-form connection (2,2) of bundle connection nabla w.r.t. Local
         frame (E|_M, (e_1,e_2)) on the 3-dimensional differentiable
         manifold M]

    Python

        >>> from sage.all import *
        >>> M = Manifold(Integer(3), 'M', start_index=Integer(1))
        >>> c_xyz = M.chart(names=('x', 'y', 'z',)); (x, y, z,) = c_xyz._first_ngens(3)
        >>> E = M.vector_bundle(Integer(2), 'E')
        >>> e = E.local_frame('e')
        >>> nab = E.bundle_connection('nabla', r'\nabla')
        >>> nab[:] = Integer(0)  # initialize curvature forms
        >>> forms = nab.connection_forms()
        >>> [forms[k] for k in sorted(forms)]
        [1-form connection (1,1) of bundle connection nabla w.r.t. Local
         frame (E|_M, (e_1,e_2)) on the 3-dimensional differentiable
         manifold M,
        1-form connection (1,2) of bundle connection nabla w.r.t. Local
         frame (E|_M, (e_1,e_2)) on the 3-dimensional differentiable
         manifold M,
        1-form connection (2,1) of bundle connection nabla w.r.t. Local
         frame (E|_M, (e_1,e_2)) on the 3-dimensional differentiable
         manifold M,
        1-form connection (2,2) of bundle connection nabla w.r.t. Local
         frame (E|_M, (e_1,e_2)) on the 3-dimensional differentiable
         manifold M]

  copy(name, latex_name=None)

    Return an exact copy of `self`.

    INPUT:

    - `name` – name given to the copy

    - `latex_name` – (default: `None`) LaTeX symbol to denote the copy; if none is provided, the LaTeX symbol is set to `name`

    Note

    The name and the derived quantities are not copied.

    EXAMPLES:

    Sage

        sage: M = Manifold(3, 'M', start_index=1)
        sage: X.<x,y,z> = M.chart()
        sage: E = M.vector_bundle(2, 'E')
        sage: e = E.local_frame('e')
        sage: nab = E.bundle_connection('nabla')
        sage: nab.set_connection_form(1, 1)[:] = [x^2, x-z, y^3]
        sage: nab.set_connection_form(1, 2)[:] = [1, x, z*y^3]
        sage: nab.set_connection_form(2, 1)[:] = [1, 2, 3]
        sage: nab.set_connection_form(2, 2)[:] = [0, 0, 0]
        sage: nab.display()
        connection (1,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = x^2 dx + (x - z) dy + y^3 dz
        connection (1,2) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = dx + x dy + y^3*z dz
        connection (2,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = dx + 2 dy + 3 dz
        sage: nab_copy = nab.copy('nablo'); nab_copy
        Bundle connection nablo on the Differentiable real vector bundle
         E -> M of rank 2 over the base space 3-dimensional differentiable
         manifold M
        sage: nab is nab_copy
        False
        sage: nab == nab_copy
        True
        sage: nab_copy.display()
        connection (1,1) of bundle connection nablo w.r.t. Local frame
         (E|_M, (e_1,e_2)) = x^2 dx + (x - z) dy + y^3 dz
        connection (1,2) of bundle connection nablo w.r.t. Local frame
         (E|_M, (e_1,e_2)) = dx + x dy + y^3*z dz
        connection (2,1) of bundle connection nablo w.r.t. Local frame
         (E|_M, (e_1,e_2)) = dx + 2 dy + 3 dz

    Python

        >>> from sage.all import *
        >>> M = Manifold(Integer(3), 'M', start_index=Integer(1))
        >>> X = M.chart(names=('x', 'y', 'z',)); (x, y, z,) = X._first_ngens(3)
        >>> E = M.vector_bundle(Integer(2), 'E')
        >>> e = E.local_frame('e')
        >>> nab = E.bundle_connection('nabla')
        >>> nab.set_connection_form(Integer(1), Integer(1))[:] = [x**Integer(2), x-z, y**Integer(3)]
        >>> nab.set_connection_form(Integer(1), Integer(2))[:] = [Integer(1), x, z*y**Integer(3)]
        >>> nab.set_connection_form(Integer(2), Integer(1))[:] = [Integer(1), Integer(2), Integer(3)]
        >>> nab.set_connection_form(Integer(2), Integer(2))[:] = [Integer(0), Integer(0), Integer(0)]
        >>> nab.display()
        connection (1,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = x^2 dx + (x - z) dy + y^3 dz
        connection (1,2) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = dx + x dy + y^3*z dz
        connection (2,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = dx + 2 dy + 3 dz
        >>> nab_copy = nab.copy('nablo'); nab_copy
        Bundle connection nablo on the Differentiable real vector bundle
         E -> M of rank 2 over the base space 3-dimensional differentiable
         manifold M
        >>> nab is nab_copy
        False
        >>> nab == nab_copy
        True
        >>> nab_copy.display()
        connection (1,1) of bundle connection nablo w.r.t. Local frame
         (E|_M, (e_1,e_2)) = x^2 dx + (x - z) dy + y^3 dz
        connection (1,2) of bundle connection nablo w.r.t. Local frame
         (E|_M, (e_1,e_2)) = dx + x dy + y^3*z dz
        connection (2,1) of bundle connection nablo w.r.t. Local frame
         (E|_M, (e_1,e_2)) = dx + 2 dy + 3 dz

  curvature_form(i, j, frame=None)

    Return the curvature 2-form corresponding to the given index and local frame.

    The curvature 2-forms with respect to the frame \(e\) are the 2-forms \(\Omega^j_i\) given by the formula

    \[\Omega^j_i = \mathrm{d} \omega^j_i + \sum^n_{k=1} \omega^j_k \wedge \omega^k_i\]

    INPUT:

    - `i`, `j` – indices identifying the 2-form \(\Omega^j_i\)

    - `frame` – (default: `None`) local frame relative to which the curvature 2-forms are defined; if `None`, the default frame of the vector bundle is assumed.

    OUTPUT:

    - the 2-form \(\Omega^j_i\), as an instance of `DiffForm`

    EXAMPLES:

    Sage

        sage: M = Manifold(2, 'M', start_index=1)
        sage: X.<x,y> = M.chart()
        sage: E = M.vector_bundle(1, 'E')
        sage: nab = E.bundle_connection('nabla', latex_name=r'\nabla')
        sage: e = E.local_frame('e')
        sage: nab.set_connection_form(1, 1)[:] = [x^2, x]
        sage: curv = nab.curvature_form(1, 1); curv
        2-form curvature (1,1) of bundle connection nabla w.r.t. Local
         frame (E|_M, (e_1)) on the 2-dimensional differentiable manifold M
        sage: curv.display()
        curvature (1,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1)) = dx∧dy

    Python

        >>> from sage.all import *
        >>> M = Manifold(Integer(2), 'M', start_index=Integer(1))
        >>> X = M.chart(names=('x', 'y',)); (x, y,) = X._first_ngens(2)
        >>> E = M.vector_bundle(Integer(1), 'E')
        >>> nab = E.bundle_connection('nabla', latex_name=r'\nabla')
        >>> e = E.local_frame('e')
        >>> nab.set_connection_form(Integer(1), Integer(1))[:] = [x**Integer(2), x]
        >>> curv = nab.curvature_form(Integer(1), Integer(1)); curv
        2-form curvature (1,1) of bundle connection nabla w.r.t. Local
         frame (E|_M, (e_1)) on the 2-dimensional differentiable manifold M
        >>> curv.display()
        curvature (1,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1)) = dx∧dy

  del_other_forms(frame=None)

    Delete all the connection forms but those corresponding to `frame`.

    INPUT:

    - `frame` – (default: `None`) local frame, the connection forms w.r.t. which are to be kept; if `None`, the default frame of the vector bundle is assumed.

    EXAMPLES:

    We first create two sets of connection forms:

    Sage

        sage: M = Manifold(2, 'M', start_index=1)
        sage: X.<x,y> = M.chart()
        sage: E = M.vector_bundle(2, 'E')
        sage: nab = E.bundle_connection('nabla', latex_name=r'\nabla')
        sage: e = E.local_frame('e')
        sage: nab.set_connection_form(1, 1, frame=e)[:] = [x^2, x]
        sage: f = E.local_frame('f')
        sage: nab.add_connection_form(1, 1, frame=f)[:] = [y^2, y]
        sage: nab[e, 1, 1].display()
        connection (1,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = x^2 dx + x dy
        sage: nab[f, 1, 1].display()
        connection (1,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (f_1,f_2)) = y^2 dx + y dy

    Python

        >>> from sage.all import *
        >>> M = Manifold(Integer(2), 'M', start_index=Integer(1))
        >>> X = M.chart(names=('x', 'y',)); (x, y,) = X._first_ngens(2)
        >>> E = M.vector_bundle(Integer(2), 'E')
        >>> nab = E.bundle_connection('nabla', latex_name=r'\nabla')
        >>> e = E.local_frame('e')
        >>> nab.set_connection_form(Integer(1), Integer(1), frame=e)[:] = [x**Integer(2), x]
        >>> f = E.local_frame('f')
        >>> nab.add_connection_form(Integer(1), Integer(1), frame=f)[:] = [y**Integer(2), y]
        >>> nab[e, Integer(1), Integer(1)].display()
        connection (1,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = x^2 dx + x dy
        >>> nab[f, Integer(1), Integer(1)].display()
        connection (1,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (f_1,f_2)) = y^2 dx + y dy

    Let us delete the connection forms w.r.t. all frames except for frame `e`:

    Sage

        sage: nab.del_other_forms(e)
        sage: nab[e, 1, 1].display()
        connection (1,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = x^2 dx + x dy

    [Python]

        >>> from sage.all import *
        >>> nab.del_other_forms(e)
        >>> nab[e, Integer(1), Integer(1)].display()
        connection (1,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = x^2 dx + x dy

    The connection forms w.r.t. frame `e` have indeed been deleted:

    Sage

        sage: nab[f, :]
        Traceback (most recent call last):
        ...
        ValueError: no basis could be found for computing the components in
         the Local frame (E|_M, (e_1,e_2))

    Python

        >>> from sage.all import *
        >>> nab[f, :]
        Traceback (most recent call last):
        ...
        ValueError: no basis could be found for computing the components in
         the Local frame (E|_M, (e_1,e_2))

  display(frame=None, vector_frame=None, chart=None, only_nonzero=True)

    Display all the connection 1-forms w.r.t. to a given local frame, one per line.

    The output is either text-formatted (console mode) or LaTeX-formatted (notebook mode).

    INPUT:

    - `frame` – (default: `None`) local frame of the vector bundle relative to which the connection 1-forms are defined; if `None`, the default frame of the bundle is used

    - `vector_frame` – (default: `None`) vector frame of the manifold relative to which the connection 1-forms should be displayed; if `None`, the default frame of the local frame’s domain is used

    - `chart` – (default: `None`) chart specifying the coordinate expression of the connection 1-forms; if `None`, the default chart of the domain of `frame` is used

    - `only_nonzero` – boolean (default: `True`); if `True`, only nonzero connection coefficients are displayed

    EXAMPLES:

    Set connection 1-forms:

    Sage

        sage: M = Manifold(3, 'M', start_index=1)
        sage: X.<x,y,z> = M.chart()
        sage: E = M.vector_bundle(2, 'E')
        sage: e = E.local_frame('e') # standard frame for E
        sage: nab = E.bundle_connection('nabla', latex_name=r'\nabla'); nab
        Bundle connection nabla on the Differentiable real vector bundle
         E -> M of rank 2 over the base space 3-dimensional differentiable
         manifold M
        sage: nab[:] = 0
        sage: nab[1, 1][:] = [x, y, z]
        sage: nab[2, 2][:] = [x^2, y^2, z^2]

    Python

        >>> from sage.all import *
        >>> M = Manifold(Integer(3), 'M', start_index=Integer(1))
        >>> X = M.chart(names=('x', 'y', 'z',)); (x, y, z,) = X._first_ngens(3)
        >>> E = M.vector_bundle(Integer(2), 'E')
        >>> e = E.local_frame('e') # standard frame for E
        >>> nab = E.bundle_connection('nabla', latex_name=r'\nabla'); nab
        Bundle connection nabla on the Differentiable real vector bundle
         E -> M of rank 2 over the base space 3-dimensional differentiable
         manifold M
        >>> nab[:] = Integer(0)
        >>> nab[Integer(1), Integer(1)][:] = [x, y, z]
        >>> nab[Integer(2), Integer(2)][:] = [x**Integer(2), y**Integer(2), z**Integer(2)]

    By default, only the nonzero connection coefficients are displayed:

    Sage

        sage: nab.display()
        connection (1,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = x dx + y dy + z dz
        connection (2,2) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = x^2 dx + y^2 dy + z^2 dz
        sage: latex(nab.display())
        \begin{array}{lcl} \omega^1_{\ \, 1} = x \mathrm{d} x +
         y \mathrm{d} y + z \mathrm{d} z \\ \omega^2_{\ \, 2} = x^{2}
         \mathrm{d} x + y^{2} \mathrm{d} y + z^{2} \mathrm{d} z \end{array}

    [Python]

        >>> from sage.all import *
        >>> nab.display()
        connection (1,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = x dx + y dy + z dz
        connection (2,2) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = x^2 dx + y^2 dy + z^2 dz
        >>> latex(nab.display())
        \begin{array}{lcl} \omega^1_{\ \, 1} = x \mathrm{d} x +
         y \mathrm{d} y + z \mathrm{d} z \\ \omega^2_{\ \, 2} = x^{2}
         \mathrm{d} x + y^{2} \mathrm{d} y + z^{2} \mathrm{d} z \end{array}

    By default, the displayed connection 1-forms are those w.r.t. the default frame of the vector bundle. The aforementioned is therefore equivalent to:

    Sage

        sage: nab.display(frame=E.default_frame())
        connection (1,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = x dx + y dy + z dz
        connection (2,2) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = x^2 dx + y^2 dy + z^2 dz

    Python

        >>> from sage.all import *
        >>> nab.display(frame=E.default_frame())
        connection (1,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = x dx + y dy + z dz
        connection (2,2) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = x^2 dx + y^2 dy + z^2 dz

    Moreover, the connection 1-forms are displayed w.r.t. the default vector frame on the local frame’s domain, i.e.:

    Sage

        sage: domain = e.domain()
        sage: nab.display(vector_frame=domain.default_frame())
        connection (1,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = x dx + y dy + z dz
        connection (2,2) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = x^2 dx + y^2 dy + z^2 dz

    [Python]

        >>> from sage.all import *
        >>> domain = e.domain()
        >>> nab.display(vector_frame=domain.default_frame())
        connection (1,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = x dx + y dy + z dz
        connection (2,2) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = x^2 dx + y^2 dy + z^2 dz

    By default, the parameter `only_nonzero` is set to `True`. Otherwise, the connection 1-forms being zero are shown as well:

    Sage

        sage: nab.display(only_nonzero=False)
        connection (1,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = x dx + y dy + z dz
        connection (1,2) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = 0
        connection (2,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = 0
        connection (2,2) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = x^2 dx + y^2 dy + z^2 dz

    Python

        >>> from sage.all import *
        >>> nab.display(only_nonzero=False)
        connection (1,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = x dx + y dy + z dz
        connection (1,2) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = 0
        connection (2,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = 0
        connection (2,2) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_1,e_2)) = x^2 dx + y^2 dy + z^2 dz

  set_connection_form(i, j, frame=None)

    Return the connection form \(\omega^j_i\) in a given frame for assignment.

    See method `connection_forms()` for details about the definition of the connection forms.

    The connection forms with respect to other frames are deleted, in order to avoid any inconsistency. To keep them, use the method `add_connection_form()` instead.

    INPUT:

    - `i`, `j` – indices identifying the 1-form \(\omega^j_i\)

    - `frame` – (default: `None`) local frame in which the connection 1-form is defined; if `None`, the default frame of the vector bundle is assumed.

    OUTPUT:

    - connection 1-form \(\omega^j_i\) in the given frame, as an instance of the class `DiffForm`; if such connection 1-form did not exist previously, it is created. See method `connection_forms()` for the storage convention of the connection 1-forms.

    EXAMPLES:

    Setting the connection forms of a bundle connection w.r.t. some local frame:

    Sage

        sage: M = Manifold(2, 'M')
        sage: X.<x,y> = M.chart()
        sage: E = M.vector_bundle(2, 'E')
        sage: e = E.local_frame('e') # standard frame for E
        sage: nab = E.bundle_connection('nabla', latex_name=r'\nabla')
        sage: nab.set_connection_form(0, 1)[:] = [x^2, x]
        sage: nab[0, 1].display()
        connection (0,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_0,e_1)) = x^2 dx + x dy

    Python

        >>> from sage.all import *
        >>> M = Manifold(Integer(2), 'M')
        >>> X = M.chart(names=('x', 'y',)); (x, y,) = X._first_ngens(2)
        >>> E = M.vector_bundle(Integer(2), 'E')
        >>> e = E.local_frame('e') # standard frame for E
        >>> nab = E.bundle_connection('nabla', latex_name=r'\nabla')
        >>> nab.set_connection_form(Integer(0), Integer(1))[:] = [x**Integer(2), x]
        >>> nab[Integer(0), Integer(1)].display()
        connection (0,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_0,e_1)) = x^2 dx + x dy

    Since `e` is the vector bundle’s default local frame, its mention may be omitted:

    Sage

        sage: nab.set_connection_form(1, 0)[:] = [y^2, y]
        sage: nab[1, 0].display()
        connection (1,0) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_0,e_1)) = y^2 dx + y dy

    [Python]

        >>> from sage.all import *
        >>> nab.set_connection_form(Integer(1), Integer(0))[:] = [y**Integer(2), y]
        >>> nab[Integer(1), Integer(0)].display()
        connection (1,0) of bundle connection nabla w.r.t. Local frame
         (E|_M, (e_0,e_1)) = y^2 dx + y dy

    Setting connection 1-forms w.r.t. to another local frame:

    Sage

        sage: f = E.local_frame('f')
        sage: nab.set_connection_form(1, 1, frame=f)[:] = [x, y]
        sage: nab[f, 1, 1].display()
        connection (1,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (f_0,f_1)) = x dx + y dy

    Python

        >>> from sage.all import *
        >>> f = E.local_frame('f')
        >>> nab.set_connection_form(Integer(1), Integer(1), frame=f)[:] = [x, y]
        >>> nab[f, Integer(1), Integer(1)].display()
        connection (1,1) of bundle connection nabla w.r.t. Local frame
         (E|_M, (f_0,f_1)) = x dx + y dy

    The forms w.r.t. the frame `e` have been deleted:

    Sage

        sage: nab[e, 0, 1].display()
        Traceback (most recent call last):
        ...
        ValueError: no basis could be found for computing the components in
         the Local frame (E|_M, (f_0,f_1))

    [Python]

        >>> from sage.all import *
        >>> nab[e, Integer(0), Integer(1)].display()
        Traceback (most recent call last):
        ...
        ValueError: no basis could be found for computing the components in
         the Local frame (E|_M, (f_0,f_1))

    To keep them, use the method `add_connection_form()` instead.

  set_immutable()

    Set `self` and all restrictions of `self` immutable.

    EXAMPLES:

    An affine connection can be set immutable:

    Sage

        sage: M = Manifold(3, 'M', start_index=1)
        sage: X.<x,y,z> = M.chart()
        sage: E = M.vector_bundle(2, 'E')
        sage: e = E.local_frame('e')
        sage: nab = E.bundle_connection('nabla')
        sage: nab.set_connection_form(1, 1)[:] = [x^2, x-z, y^3]
        sage: nab.set_connection_form(1, 2)[:] = [1, x, z*y^3]
        sage: nab.set_connection_form(2, 1)[:] = [1, 2, 3]
        sage: nab.set_connection_form(2, 2)[:] = [0, 0, 0]
        sage: nab.is_immutable()
        False
        sage: nab.set_immutable()
        sage: nab.is_immutable()
        True

    Python

        >>> from sage.all import *
        >>> M = Manifold(Integer(3), 'M', start_index=Integer(1))
        >>> X = M.chart(names=('x', 'y', 'z',)); (x, y, z,) = X._first_ngens(3)
        >>> E = M.vector_bundle(Integer(2), 'E')
        >>> e = E.local_frame('e')
        >>> nab = E.bundle_connection('nabla')
        >>> nab.set_connection_form(Integer(1), Integer(1))[:] = [x**Integer(2), x-z, y**Integer(3)]
        >>> nab.set_connection_form(Integer(1), Integer(2))[:] = [Integer(1), x, z*y**Integer(3)]
        >>> nab.set_connection_form(Integer(2), Integer(1))[:] = [Integer(1), Integer(2), Integer(3)]
        >>> nab.set_connection_form(Integer(2), Integer(2))[:] = [Integer(0), Integer(0), Integer(0)]
        >>> nab.is_immutable()
        False
        >>> nab.set_immutable()
        >>> nab.is_immutable()
        True

    The coefficients of immutable elements cannot be changed:

    Sage

        sage: f = E.local_frame('f')
        sage: nab.add_connection_form(1, 1, frame=f)[:] = [x, y, z]
        Traceback (most recent call last):
        ...
        ValueError: object is immutable; please change a copy instead

    [Python]

        >>> from sage.all import *
        >>> f = E.local_frame('f')
        >>> nab.add_connection_form(Integer(1), Integer(1), frame=f)[:] = [x, y, z]
        Traceback (most recent call last):
        ...
        ValueError: object is immutable; please change a copy instead

  vector_bundle()

    Return the vector bundle on which the bundle connection is defined.

    OUTPUT:

    - instance of class `DifferentiableVectorBundle` representing the vector bundle on which `self` is defined.

    EXAMPLES:

    Sage

        sage: M = Manifold(3, 'M', start_index=1)
        sage: c_xyz.<x,y,z> = M.chart()
        sage: E = M.vector_bundle(2, 'E')
        sage: nab = E.bundle_connection('nabla', r'\nabla')
        sage: nab.vector_bundle()
        Differentiable real vector bundle E -> M of rank 2 over the base
         space 3-dimensional differentiable manifold M

    Python

        >>> from sage.all import *
        >>> M = Manifold(Integer(3), 'M', start_index=Integer(1))
        >>> c_xyz = M.chart(names=('x', 'y', 'z',)); (x, y, z,) = c_xyz._first_ngens(3)
        >>> E = M.vector_bundle(Integer(2), 'E')
        >>> nab = E.bundle_connection('nabla', r'\nabla')
        >>> nab.vector_bundle()
        Differentiable real vector bundle E -> M of rank 2 over the base
         space 3-dimensional differentiable manifold M