公告:网站程序已升级到1.8.3,修复了提问时可能报错的问题,请清除浏览器缓存
2019-11-10

欢迎来到 Mathematica 问答社区

提问时请贴上文本代码

语法高亮:在编辑器中点击

被禁止的话题:广告破解

请阅读:《提问的智慧》

备用域名:mma.ooo

支持LaTex数学公式
行内公式标识符:\$ 或“$\backslash ($”+“$\backslash )$”,
行间公式标识符:\$\$ 或 “$\backslash [$”+“$\backslash ]$”

社区建议QQ群:365716997

分类

–1 投票
88 浏览
lsEigenvalue[H_] := Module[{emax, emaxspace, emin, eminspace, es},

  es = Sort[Eigenvalues[H], Re[#1] < Re[#2] &];

  emin = First[es];

  emax = Last[es];

  eminspace =

   Orthogonalize[NullSpace[H - emin*IdentityMatrix[Length[H]]];

    emaxspace =

     Orthogonalize[NullSpace[H - emax*IdentityMatrix[Length[H]]];

        Return[{{emin, eminspace}, {emax, emaxspace}}]

        ]

       plotNR[A_, n_] :=

      Module[{t = 0., td = 2  \[Pi]/n, Ht, Kt, points = {},

        segment = {} , emax , emaxspace, emin, eminspace, vp, vm, Q,

        R},

       PrintTemporary[ProgressIndicator[Dynamic[t], {0, 2 \[Pi]}]];

       While[t < 2 \[Pi],

        Ht = (Exp[-I t]*A + Exp[I t]*ConjugateTranspose[A])/2;

        {emax, emaxspace} = Last[lsEigenvalue[Ht]];

        which[(* One dimensional eigenspace *)

         Length[emaxspace] == 1,

         

         vp = First[emaxspace];

         AppendTo[points, Conjugate[vp].A.vp],

         Length[emaxspace] > 1,

         Kt = (Exp[-I t]*A - Exp[I t]*ConjugateTranspose[A])/(2 I);

         Q = Transpose[emaxspace];

         R = ConjugateTranspose[Q].Kt.Q;

         

         {{emin, eminspace}, {emax, emaxspace}} = lsEigenvalue[R];

         

         vp = Q.First[emaxspace];

         vm = Q.First[eminspace];

         

         AppendTo[segments, {Conjugate[vm].A.vm, Conjugate[vp].A.vp}],

         

         (* Fail *)

         Ture,

         Print["Error"]

         ];

        

        t = t + td;

        ];

       Return {DeleteDuplicates[points], DeleteDuplicates[segments]}]

    ]

此代码如何输入矩阵进行计算?
分类:矩阵 | 用户: osu460991 (11 分)
请务必先检查拼写错误和语法错误。

登录 或者 注册 后回答这个问题。

...