{ "cells": [ { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ ], "source": [ "%display latex" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ ], "source": [ "theta, phi, psi = var('theta, phi, psi')" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ] }, "execution_count": 4, "metadata": { }, "output_type": "execute_result" } ], "source": [ "R1 = matrix([[cos(phi),-sin(phi),0],[sin(phi),cos(phi),0],[0,0,1]]); R1" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ] }, "execution_count": 5, "metadata": { }, "output_type": "execute_result" } ], "source": [ "R2 = matrix([[1,0,0],[0,cos(theta),-sin(theta)],[0,sin(theta),cos(theta)]]); R2" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ] }, "execution_count": 8, "metadata": { }, "output_type": "execute_result" } ], "source": [ "Lambda = R1.apply_map(lambda x: x(phi=phi-pi/2))*R2.apply_map(lambda x: x(theta=-theta)); Lambda.simplify_full()" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ] }, "execution_count": 9, "metadata": { }, "output_type": "execute_result" } ], "source": [ "(Lambda*Lambda.transpose()).simplify_trig()" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ] }, "execution_count": 14, "metadata": { }, "output_type": "execute_result" } ], "source": [ "e = [matrix([[1,0,0],[0,-1,0],[0,0,0]]), matrix([[0,1,0],[1,0,0],[0,0,0]])]; e" ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ] }, "execution_count": 15, "metadata": { }, "output_type": "execute_result" }, { "data": { "text/html": [ "" ] }, "execution_count": 15, "metadata": { }, "output_type": "execute_result" } ], "source": [ "for i in range(2):\n", " show((Lambda.transpose()*e[i]*Lambda).simplify_trig())" ] }, { "cell_type": "code", "execution_count": 16, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ] }, "execution_count": 16, "metadata": { }, "output_type": "execute_result" }, { "data": { "text/html": [ "" ] }, "execution_count": 16, "metadata": { }, "output_type": "execute_result" } ], "source": [ "for i in range(2):\n", " show((Lambda*e[i]*Lambda.transpose()).simplify_trig())" ] }, { "cell_type": "code", "execution_count": 0, "metadata": { "collapsed": false }, "outputs": [ ], "source": [ ] } ], "metadata": { "kernelspec": { "display_name": "SageMath 8.2", "language": "sagemath", "metadata": { "cocalc": { "description": "Open-source mathematical software system", "priority": 1, "url": "https://www.sagemath.org/" } }, "name": "sage-8.2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.14" } }, "nbformat": 4, "nbformat_minor": 4 }