|
|
| Linha 32: |
Linha 32: |
| . | | . |
| == Método Monte Carlo == | | == Método Monte Carlo == |
| | |
| | === Algorítmo de Metrópolis === |
|
| |
|
| Dado uma amostra com <math>N</math> partículas, a abordagem introduzida por Metropolis segue o seguinte esquema: | | Dado uma amostra com <math>N</math> partículas, a abordagem introduzida por Metropolis segue o seguinte esquema: |
|
| |
|
| <math>\frac{\Psi^{n}_{j-1} - 2\Psi^{n}_{j} + \Psi^{n}_{j+1}}{\left(\Delta x \right)^2}</math>
| | === Condições de Contorno === |
| | |
| e as discretizações de <math>\frac{\partial \Psi}{\partial t}</math> (explícita e implícita, respectivamente):
| |
| | |
| <math>\frac{\partial \Psi}{\partial t} = \frac{\Psi^{n+1}_{j} - \Psi^{n}_{j}}{\Delta t}</math> (explícita)
| |
| | |
| <math>\frac{\partial \Psi}{\partial t} = \frac{\Psi^{n}_{j} - \Psi^{n-1}_{j}}{\Delta t}</math> (implícita)
| |
| | |
| Tanto no método explícito quanto no método implícito não é conservada a norma do estado (o que é estritamente necessário, já que o estado pode ser interpretado como uma onda de probabilidade). Por esse motivo, utiliza-se o método de Crank-Nicolson, o qual tem essa propriedade.
| |
| | |
| O método de Crank-Nicolson consiste em uma média aritmética dos métodos explícito e implícito. Excetuando manipulações algébricas triviais, verifica-se que a relação de recorrência do método é dada por:
| |
| | |
| <math>a\Psi^{n+1}_{j-1} + b_{j}\Psi^{n+1}_{j} + a\Psi^{n+1}_{j+1} = a^* \Psi^{n}_{j-1} + b_{j}^{*} \Psi^{n}_{j} + a^*\Psi^{n}_{j+1},</math>
| |
| | |
| onde
| |
| | |
| <math>a \equiv -\frac{i \Delta t}{4(\Delta x)^2}</math> e <math>b_{j} \equiv 1+\frac{ i\Delta t}{2} \left[\frac{1}{(\Delta x)^2} + V(j \Delta x) \right]</math>.
| |
| | |
| A integração numérica depende, portanto, do potencial em que o elétron está sujeito, bem como da sua condição inicial e suas das condições de contorno.
| |
| | |
| Que condições podemos impor para a fronteira? Quando se trata do problema analiticamente, costuma-se considerar que a função de onda tende a zero no infinito. Numericamente, pode-se fazer uma transposição disso, criando uma condição para bordas em pontos suficientemente distantes do centro da distribuição da função de onda, igualando-as a zero. Outra forma de tratar o problema numericamente é criando condições de contorno periódicas, em que para as bordas vale <math>\Psi^{n}_{0} = \Psi^{n}_{j_{max}}</math> para todo <math>n</math> (ou, para as bordas <math>a</math> e <math>b</math> há a relação <math>\Psi (a, t) = \Psi (b, t)</math> para todo <math>t</math>).
| |
| | |
| ===Condições de contorno iguais a zero=== | |
| Para as condições de contorno <math>\Psi_0^n = \Psi_L^n = 0</math>, a iteração reduz-se à equação matricial:
| |
| | |
| :<math>
| |
| \begin{pmatrix}
| |
| b_1 & a & 0 & \cdots & 0 & 0 & 0\\ a & b_2 & a & \cdots & 0 & 0 & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots& \vdots& \vdots \\ 0 & 0 & 0 & \cdots & a & b_{L-2} & a \\ 0 & 0 & 0 & \cdots & 0 & a & b_{L-1}
| |
| \end{pmatrix}
| |
| \begin{pmatrix} \Psi_1^{n+1} \\ \Psi_2^{n+1} \\ \vdots \\ \Psi_{L-2}^{n+1} \\ \Psi_{L-1}^{n+1} \end{pmatrix}
| |
| =
| |
| \begin{pmatrix} b_1^* & a^* & 0 & \cdots & 0 & 0 & 0\\ a^* & b_2^* & a^* & \cdots & 0 & 0 & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots& \vdots& \vdots \\ 0 & 0 & 0 & \cdots & a^* & b_{L-2}^* & a^* \\ 0 & 0 & 0 & \cdots & 0 & a^* & b_{L-1}^*\end{pmatrix}
| |
| \begin{pmatrix} \Psi_1^{n} \\ \Psi_2^{n} \\ \vdots \\ \Psi_{L-2}^{n} \\ \Psi_{L-1}^{n} \end{pmatrix}
| |
| </math>
| |
| | |
| | |
| ===Condições de contorno periódicas=== | |
| De maneira semelhante, a iteração do caso das condições de contorno periódicas - <math>\Psi_0^n = \Psi_L^n</math> - reduz-se à equação matricial:
| |
| :<math>
| |
| \begin{pmatrix} b_0 & a & 0 & \cdots & 0 & 0 & a\\ a & b_1 & a & \cdots & 0 & 0 & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots& \vdots& \vdots \\ 0 & 0 & 0 & \cdots & a & b_{L-1} & a \\ a & 0 & 0 & \cdots & 0 & a & b_{L}\end{pmatrix}
| |
| \begin{pmatrix} \Psi_0^{n+1} \\ \Psi_2^{n+1} \\ \vdots \\ \Psi_{L-1}^{n+1} \\ \Psi_{L}^{n+1} \end{pmatrix}
| |
| =
| |
| \begin{pmatrix} b_0^* & a^* & 0 & \cdots & 0 & 0 & a^*\\ a^* & b_1^* & a^* & \cdots & 0 & 0 & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots& \vdots& \vdots \\ 0 & 0 & 0 & \cdots & a^* & b_{L-1}^* & a^* \\ a^* & 0 & 0 & \cdots & 0 & a^* & b_{L}^*\end{pmatrix}
| |
| \begin{pmatrix} \Psi_0^{n} \\ \Psi_2^{n} \\ \vdots \\ \Psi_{L-1}^{n} \\ \Psi_{L}^{n} \end{pmatrix}
| |
| </math>
| |
|
| |
|
| | === Truncagem nas interações === |
|
| |
|
| ===Condição inicial=== | | === Translação === |
| Já a condição inicial é arbitrária, pois define o estado inicial do sistema que queremos tratar. Fazendo uma referência ao tratamento de sistemas clássicos, seria como definir posição e momento iniciais. É claro que, para ter o sentido físico de uma função de onda, deve-se ter o cuidado de criar uma condição inicial normalizada, satisfazendo
| |
|
| |
|
| <math>\int _{-\infty}^{\infty} \, \left| \Psi (x, 0) \right| ^2 \, dx = 1</math>
| | === Estimadores no Equilíbrio === |
|
| |
|
| bastando, então, inseri-la no programa.
| | == Diagramas de fase == |
|
| |
|
| ==Implementação em C== | | ==Implementação em C== |
O potencial devido a interação entre duas partículas separadas por uma distância pode ser modelado pelo potencial de Lennar Jones:
Posto em unidades reduzidas ( e ), o potencial reduz-se a:
Trabalha-se, por conveniência, com o seguintes sistema de unidades básicas:
| Grandeza
|
Comprimero
|
Tempo
|
Massa
|
Temperatura
|
Energia
|
Pressão
|
Densidade
|
| Unidade
|
|
|
|
|
|
|
|
onde é a massa da partícula e é a constante de Boltzmann.
.
Método Monte Carlo
Algorítmo de Metrópolis
Dado uma amostra com partículas, a abordagem introduzida por Metropolis segue o seguinte esquema:
Condições de Contorno
Truncagem nas interações
Translação
Estimadores no Equilíbrio
Diagramas de fase
Implementação em C
#include <stdio.h>
#include <math.h>
#include <complex.h>
#define N_steps 100000
#define L 1000
#define dt 1
#define dx 4.0
#define w 0.002
double V(int x_rel)
{
return - pow(w,2) * pow(x_rel - 500,2) / 2.0; //SHO
//return 0;
}
double complex b(int i)
{
return 0.5 * dt * I * (1.0 / pow(dx,2.0) + V(i)) + 1.0;
}
double u_0(int x_rel)
{
//return sqrt(2 / L) * sin(5*x_rel * M_PI / L); //eigenstate of infinite square well
//return (1.0/ sqrt(5 * M_PI)) * exp(I * 0.5 * x_rel) * exp(-pow(x_rel - 500, 2) / (2 * 25)); //gaussian packet
return (w / M_PI) * exp(-w * pow(x_rel - 500, 2) / 2.0);
}
void CN(double complex *u, double complex *u_aux, double complex *u_next, double complex a, int bi)
{
//bi = 1 (bounded); bi = 0 (periodic)
int i;
for(i = bi; i <= L - bi; i++) u_aux[i] = conj(a) * (u[(i-1+L)%L] + u[(i+1+L)%L]) + conj(b(i)) * u[i];
//thomas algorithm
double complex c_new[L+1], d_new[L+1];
c_new[bi] = a / b(bi);
for(i = 1 + bi; i <= L - bi; i++) c_new[i] = a / (b(i) - c_new[i-1] * a);
d_new[bi] = u_aux[bi] / b(bi);
for(i = 1 + bi; i <= L - bi; i++) d_new[i] = (u_aux[i] - d_new[i-1] * a) / (b(i) - c_new[i-1] * a);
if (bi == 1) u_next[0] = u_next[L] = 0;
u_next[L-bi] = d_new[L-bi];
for(i = L-1-bi; i >= bi; i --) u_next[i] = d_new[i] - c_new[i] * u_next[i+1];
//u = u_next
for(i = 0; i <= L; i++) u[i] = u_next[i];
}
int main(void)
{
int i, j, n = 0;
double complex u[L+1], u_next[L+1], u_aux[L+1], a = - 0.25 * I * dt / pow(dx,2.0);
//Initial Contition
for(i = 0; i <= L; i ++) u[i] = u_0(i);
while(n < N_steps)
{
CN(u, u_aux, u_next, a, 0);
printf("set title 'Time = %d'\nplot \'-' w lp pt 7 ps 0.1", n);
for(i = 0; i <= L; i ++) printf("%d\t%.10lf\n",i,pow(creal(u[i]),2) + pow(cimag(u[i]),2));
//for(i = 0; i <= L; i ++) printf("%d\t%lf\n",i,cimag(u[i]));
//for(i = 0; i <= L; i ++) printf("%d\t%lf\n",i,creal(u[i]));
printf("e\npause 0.1\n");
n ++;
}
return 0;
}
Referências
- Cohen-Tannoudji C., Diu B., Laloe F. Quantum mechanics. Volume 1. Wiley, 1991.
- Numerical Resolution Of The Schrödinger Equation. Jorgensen L., Lopes Cardozo D., Thivierge E. http://web.pa.msu.edu/people/duxbury/courses/phy480/SchrodingerDynamics.pdf
- Crank, J.; Nicolson, P. (1947). "A practical method for numerical evaluation of solutions of partial differential equations of the heat conduction type". Proc. Camb. Phil. Soc. 43 (1): 50–67. doi:10.1007/BF02127704.
- Sherer, Philipp O.J., Computational Physics simulation of Classical and Quantum Systems. Springer, 2010.
- Born M., Nobel lecture: The statistical interpretation of quantum mechanics. 11 de Dezembro de 1954. https://www.nobelprize.org/nobel_prizes/physics/laureates/1954/born-lecture.pdf