Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| documentation:language_reference:objects:matrix:functions:addspin [2018/09/25 11:45] – created Simon Heinze | documentation:language_reference:objects:matrix:functions:addspin [2024/12/12 16:58] (current) – Maurits W. Haverkort | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ### | ### | ||
| - | Matrix.AddSpin($M$) takes a Matrix $M$ that acts on a space with no spin included and returns the matrix doubled in size, where every former entry now splits in spin-up and spin-down. This behaviour is equivalent to calling // | + | Matrix.AddSpin($M$) takes a Matrix $M$ that acts on a space with no spin included and returns the matrix doubled in size, where every former entry now splits in spin-up and spin-down. We assume the ordering of the basis alternates between spin up and down. This behaviour is equivalent to calling // | 
| ### | ### | ||
| ===== Example ===== | ===== Example ===== | ||
| - | |||
| - | ### | ||
| - | An example will follow one day. | ||
| - | ### | ||
| ==== Input ==== | ==== Input ==== | ||
| <code Quanty Example.Quanty> | <code Quanty Example.Quanty> | ||
| - | -- some example code | + | A = Matrix.New({{1, | 
| + | B = Matrix.AddSpin(A) | ||
| + | print(B) | ||
| </ | </ | ||
| ==== Result ==== | ==== Result ==== | ||
| <file Quanty_Output> | <file Quanty_Output> | ||
| - | text produced as output | + | { { 1 , 0 , 2 , 0 } , | 
| + | { 0 , 1 , 0 , 2 } , | ||
| + | { 3 , 0 , 4 , 0 } , | ||
| + | { 0 , 3 , 0 , 4 } } | ||
| </ | </ | ||
| ===== Table of contents ===== | ===== Table of contents ===== | ||
| - | {{indexmenu> | + | {{indexmenu> |