{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Symmetric tensors" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "using TensorDec" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We consider symmetric tensors or equivalently homogeneous polynomials, in the following variables:" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "X = @ring x0 x1 x2;" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A symmetric tensor of order d=4 and of rank 3." ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "0.5x0^{4} - 2.0x0^{3}x1 + 11.0x0^{3}x2 + 15.0x0^{2}x1^{2} + 9.0x0^{2}x1x2 - 8.625x0^{2}x2^{2} - 2.0x0x1^{3} + 9.0x0x1^{2}x2 + 6.75x0x1x2^{2} + 9.6875x0x2^{3} + 2.5x1^{4} + 3.0x1^{3}x2 + 3.375x1^{2}x2^{2} + 1.6875x1x2^{3} - 1.68359375x2^{4}" ], "text/plain": [ "0.5x0⁴ - 2.0x0³x1 + 11.0x0³x2 + 15.0x0²x1² + 9.0x0²x1x2 - 8.625x0²x2² - 2.0x0x1³ + 9.0x0x1²x2 + 6.75x0x1x2² + 9.6875x0x2³ + 2.5x1⁴ + 3.0x1³x2 + 3.375x1²x2² + 1.6875x1x2³ - 1.68359375x2⁴" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "d=4; F = (x0+x1+0.75x2)^d + 1.5*(x0-x1)^d -2.0*(x0-x2)^d" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The graph of the homogeneous polynomial $(x_0+x_1+0.75x_2)^4 + 1.5(x_0-x_1)^4 -2(x_0-x_2)^4$ in polar coordinates on the sphere looks like this:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "![tensor](tensor.png)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We associate to $t$, the following (truncated) series in the dual variables, after substituting $x_0$ by 1:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Computing its decomposition" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "w, Xi = decompose(F);" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "yields the weights `w`" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3-element Array{Float64,1}:\n", " 1.4999999999999996\n", " -1.9999999999999987\n", " 0.9999999999999999" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "w" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "and the corresponding points $\\Xi$, which are the coefficient vectors of $x_0, x_1, x_2$ in the linear forms of the decomposition of the tensor F. They are normalized to have norm 1:" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3×3 Array{Float64,2}:\n", " 1.0 1.0 1.0 \n", " -1.0 4.15916e-16 1.0 \n", " 1.03483e-16 -1.0 0.75" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Xi" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "anaconda-cloud": {}, "kernelspec": { "display_name": "Julia 1.0.0", "language": "julia", "name": "julia-1.0" }, "language_info": { "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", "version": "1.0.0" } }, "nbformat": 4, "nbformat_minor": 1 }