跳至内容

MC-04 测量

除了能量、磁化强度这类热力学平均值之外,量子蒙特卡洛模拟还可以测量空间关联函数及其傅里叶变换。 本教程在小正方格子上,用有向圈随机级数展开程序对 S=1/2S = 1/2 海森堡模型演示这些测量。

自旋-自旋关联函数 C(r)=⟨S0zSrz⟩C(\mathbf{r}) = \langle S^z_0 S^z_\mathbf{r} \rangle 描述了相距 r\mathbf{r} 的两个格点上自旋取向之间的关联。 对于低温下的反铁磁海森堡模型,关联随距离交替变号,反映了系统趋向奈尔序的倾向。 结构因子 S(q)=∑reiq⋅rC(r)S(\mathbf{q}) = \sum_\mathbf{r} e^{i\mathbf{q}\cdot\mathbf{r}} C(\mathbf{r}) 是关联函数的傅里叶变换;它在反铁磁波矢 q=(π,π)\mathbf{q} = (\pi, \pi) 处出现峰值。

二维海森堡正方格子

我们在 4×44 \times 4 正方格子上模拟 S=1/2S = 1/2 海森堡模型,温度取 T=0.3T = 0.3,并加上一个小磁场 h=0.1h = 0.1 以弱破缺自旋旋转对称性。 较小的系统尺寸使模拟运行得很快;不过在这个尺度上,有限尺寸效应是显著的。

命令行

参数文件 parm4 在标准参数之外,还开启了三个额外的测量开关:

MODEL="spin"
LATTICE="square lattice"
local_S=1/2
MEASURE[Correlations]=true
MEASURE[Structure Factor]=true
MEASURE[Green Function]=true
THERMALIZATION=10000
SWEEPS=500000
J=1
L=4
W=4
T=0.3
{h=0.1;}

MEASURE[Correlations] 记录所有格点对的 ⟨SizSjz⟩\langle S^z_i S^z_j \rangle。 MEASURE[Structure Factor] 记录所有与该晶格相容的波矢处的 S(q)S(\mathbf{q})。 MEASURE[Green Function] 记录虚时(单格点)格林函数 G(τ)=⟨Siz(τ) Siz(0)⟩G(\tau) = \langle S^z_i(\tau)\,S^z_i(0)\rangle,它在长 τ\tau 下按 G(τ)∼e−ΔτG(\tau)\sim e^{-\Delta\tau} 衰减,并且可以通过解析延拓获得谱信息。

转换并运行:

parameter2xml parm4
dirloop_sse --Tmin 10 --write-xml parm4.in.xml

--Tmin 10 把检查点间隔设为 10 秒;--write-xml 会写出 XML 输出文件,pyalps 可以把它与 HDF5 结果一起读取。

Python

脚本 tutorial4.py:

import pyalps

parms = [{
    'LATTICE'                   : "square lattice",
    'MODEL'                     : "spin",
    'MEASURE[Correlations]'     : True,
    'MEASURE[Structure Factor]' : True,
    'MEASURE[Green Function]'   : True,
    'local_S'                   : 0.5,
    'T'                         : 0.3,
    'J'                         : 1,
    'THERMALIZATION'            : 10000,
    'SWEEPS'                    : 500000,
    'L'                         : 4,
    'W'                         : 4,
    'h'                         : 0.1
}]

input_file = pyalps.writeInputFiles('parm4', parms)
pyalps.runApplication('dirloop_sse', input_file, Tmin=10)

计算结果的读取

从输出文件中载入全部测量结果并打印出来:

import pyalps

data = pyalps.loadMeasurements(pyalps.getResultFiles(prefix='parm4'))

for s in pyalps.flatten(data):
    if len(s.x) == 1:
        print(s.props['observable'], ':', s.y[0])
    else:
        for (x, y) in zip(s.x, s.y):
            print(s.props['observable'], x, ':', y)

标量可观测量(能量、磁化强度、磁化率)打印在一行里。 矢量可观测量(关联函数、结构因子、格林函数)则每个条目占一行,并在数值旁边给出其指标——格点对、波矢或虚时格点。

绘制自旋-自旋关联

要把关联函数可视化,载入 Sz Correlations 可观测量并作图:

import pyalps
import matplotlib.pyplot as plt
import pyalps.plot

data = pyalps.loadMeasurements(pyalps.getResultFiles(prefix='parm4'), 'Sz Correlations')
correlations = pyalps.collectXY(data, x='d', y='Sz Correlations')

plt.figure()
pyalps.plot.plot(correlations)
plt.xlabel('Distance $r$')
plt.ylabel('$\\langle S^z_0 S^z_r \\rangle$')
plt.title('Spin correlations, $4\\times 4$ Heisenberg model')
plt.show()

关联应当随距离交替变号,其中最近邻的值为负(反铁磁),并且其大小随 rr 减小。

绘制结构因子

import pyalps
import matplotlib.pyplot as plt
import pyalps.plot

data = pyalps.loadMeasurements(pyalps.getResultFiles(prefix='parm4'), 'Sz Structure Factor')
structure_factor = pyalps.collectXY(data, x='q', y='Sz Structure Factor')

plt.figure()
pyalps.plot.plot(structure_factor)
plt.xlabel('Wavevector $q$')
plt.ylabel('$S^z(q)$')
plt.title('Structure factor, $4\\times 4$ Heisenberg model')
plt.show()

最大值应当出现在反铁磁波矢 q=(π,π)\mathbf{q} = (\pi, \pi) 处,它对应于奈尔序中交替排列的自旋图样。

思考题

  • 结构因子在哪个波矢处最大?这对应于怎样的自旋关联图样?
  • 关联 ⟨S0zSrz⟩\langle S^z_0 S^z_r \rangle 如何随距离 rr 衰减?在整个 4×44 \times 4 格子范围内它们是否都还显著?
  • 在更低的温度下重复模拟,例如 T=0.1T = 0.1。关联函数和结构因子会如何变化?
  • 把系统尺寸增大到 L=8L = 8。结构因子的峰值如何随 LL 标度?这告诉你在有限温度下是否存在长程序?
  • 格林函数 G(τ)G(\tau) 的物理含义是什么?如何利用它来获得系统的动力学信息?