<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://e6.ijs.si/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=APirnat</id>
		<title>Medusa: Coordinate Free Mehless Method implementation - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://e6.ijs.si/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=APirnat"/>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=Special:Contributions/APirnat"/>
		<updated>2026-05-13T21:32:52Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.1</generator>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=Complex-valued_problems&amp;diff=2676</id>
		<title>Complex-valued problems</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=Complex-valued_problems&amp;diff=2676"/>
				<updated>2019-07-19T14:29:30Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
Our library natively supports complex numbers. To demonstrate this a tutorial for solving Poisson's equation is presented below. For more complicated complex-valued problems see [[Electromagnetic scattering]] and [[Schrödinger equation]].&lt;br /&gt;
&lt;br /&gt;
== 2D Complex Poisson's equation ==&lt;br /&gt;
We are solving 2D complex Poisson equation, on a unit square with Dirichlet boundary conditions &lt;br /&gt;
&lt;br /&gt;
\[&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	i \Delta u &amp;amp;= f      &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega,&lt;br /&gt;
\end{align*}&lt;br /&gt;
\]&lt;br /&gt;
where $u(x,y)$ is the solution to the problem and $\Omega = [0, 1] \times [0, 1]$ the square domain. We will consider $f(x,y) = 2\pi^2\sin(\pi x)\sin(\pi y)$, as it makes for &lt;br /&gt;
a simple solution $u(x,y) = i\sin(\pi x)\sin(\pi y)$.&lt;br /&gt;
&lt;br /&gt;
We write the equations for our problem by directly translating the mathematical formulation above into the code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
for (int i : domain.interior()) {&lt;br /&gt;
    double x = domain.pos(i, 0);&lt;br /&gt;
    double y = domain.pos(i, 1);&lt;br /&gt;
    1.0_i * op.lap(i) = 2*PI*PI*sin(PI * x)*sin(PI * y);&lt;br /&gt;
}&lt;br /&gt;
for (int i : domain.boundary()) {&lt;br /&gt;
    op.value(i) = 0.0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The solution $u(x,y)$ is plotted below. In our case solution consists only of the imaginary part, the real part is equal to zero. &lt;br /&gt;
&lt;br /&gt;
[[File:complex_poisson_2D_real.png|500px]]&lt;br /&gt;
[[File:complex_poisson_2D_imag.png|500px]]&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=Complex-valued_problems&amp;diff=2675</id>
		<title>Complex-valued problems</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=Complex-valued_problems&amp;diff=2675"/>
				<updated>2019-07-19T14:23:11Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
Our library natively supports complex numbers. To demonstrate this a tutorial for solving Poisson's equation is presented below. For more complicated complex-valued problems see [[Electromagnetic scattering]] and [[Schrödinger equation]].&lt;br /&gt;
&lt;br /&gt;
== 2D Complex Poisson's equation ==&lt;br /&gt;
We are solving 2D complex Poisson equation, on a unit square with Dirichlet boundary conditions &lt;br /&gt;
&lt;br /&gt;
\[&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	i \Delta u &amp;amp;= f      &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega,&lt;br /&gt;
\end{align*}&lt;br /&gt;
\]&lt;br /&gt;
where $u(x,y)$ is the solution to the problem and $\Omega = [0, 1] \times [0, 1]$ denotes the square domain. We will consider $f(x,y) = 2\pi^2\sin(\pi x)\sin(\pi y)$, as it makes for &lt;br /&gt;
a simple solution $u(x,y) = i\sin(\pi x)\sin(\pi y)$.&lt;br /&gt;
&lt;br /&gt;
We write the equations for our problem by directly translating the mathematical formulation above into the code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
for (int i : domain.interior()) {&lt;br /&gt;
    double x = domain.pos(i, 0);&lt;br /&gt;
    double y = domain.pos(i, 1);&lt;br /&gt;
    1.0_i * op.lap(i) = 2*PI*PI*sin(PI * x)*sin(PI * y);&lt;br /&gt;
}&lt;br /&gt;
for (int i : domain.boundary()) {&lt;br /&gt;
    op.value(i) = 0.0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The solution $u(x,y)$ is plotted below. In our case solution consists only of the imaginary part, the real part is equal to zero. &lt;br /&gt;
&lt;br /&gt;
[[File:complex_poisson_2D_real.png|500px]]&lt;br /&gt;
[[File:complex_poisson_2D_imag.png|500px]]&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2674</id>
		<title>Schrödinger equation</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2674"/>
				<updated>2019-07-19T14:19:31Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
== 2D infinite square well ==&lt;br /&gt;
We are solving a Schrödinger equation for a quantum particle that is confined to a 2-dimensional square box, $0&amp;lt;x&amp;lt;L$ and $0&amp;lt;y&amp;lt;L$.  Within this square the particle behaves as a free particle, but the walls are impenetrable, so the wave function  is zero at the walls. This is described by the infinite potential&lt;br /&gt;
&lt;br /&gt;
\[&lt;br /&gt;
V(x)=&lt;br /&gt;
\begin{cases}&lt;br /&gt;
0, &amp;amp;0&amp;lt;x&amp;lt;L,\: 0&amp;lt;y&amp;lt;L,&lt;br /&gt;
\\&lt;br /&gt;
\infty, &amp;amp;{\text{otherwise.}}&lt;br /&gt;
\end{cases}&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
With this potential Schrödinger equation simplifies to &lt;br /&gt;
\[&lt;br /&gt;
-{\hbar^2 \over 2m} \nabla^2 \Psi(x,y,t) = i\hbar {\partial \over \partial t}\Psi(x,y,t),&lt;br /&gt;
\]&lt;br /&gt;
where $m$ is the mass of the particle, $\hbar$ is reduced Planck constant and $\Psi(x,y,t)$ is the wave function. We set $\hbar / 2m = 1$ and $L=1$. &lt;br /&gt;
&lt;br /&gt;
The solution $\Psi(x,y,t)$ must therefore satisfy&lt;br /&gt;
\[&lt;br /&gt;
\nabla^2 \Psi = -i{\partial \over \partial t}\Psi \quad \text{in} \quad \Omega,&lt;br /&gt;
\]&lt;br /&gt;
with Dirichlet boundary condition&lt;br /&gt;
\[&lt;br /&gt;
\Psi = 0 \quad \text{on} \quad \partial \Omega,&lt;br /&gt;
\]&lt;br /&gt;
where $\Omega=[0, 1]\times[0, 1]$ denotes the square box domain and $\partial \Omega$ is the boundary of the domain. In order to get the unique solution for the time propagation of the wave function, the initial state $\Psi(x, y,t= 0)$ has to be selected. We choose &lt;br /&gt;
\[&lt;br /&gt;
\Psi(x,y,t=0) = \sin{(\pi x)} \sin{(\pi y)}.&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
Once we prepare the domain and operators, we can turn the Schrödinger equation into code. As we are solving the time propagation implicitly, we will have to solve a matrix equation for every step. For this reason a space matrix $M$ is constructed. Next the equations are implemented, $psi$ denotes the matrix solution for each step and $rhs$ the right-hand side of the matrix equation, which is in our case equivalent to the previous state $psi$. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;complex&amp;lt;double&amp;gt;, RowMajor&amp;gt; M(N, N);&lt;br /&gt;
&lt;br /&gt;
// Set initial state.&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    double x = domain.pos(i, 0);&lt;br /&gt;
    double y = domain.pos(i, 1);&lt;br /&gt;
    rhs(i) = sin(PI * x) * sin(PI * y);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Set equation on interior.&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    op.value(i) + (-1.0_i) * dt * op.lap(i) = rhs(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Set equation on boundary.&lt;br /&gt;
for (int i: domain.boundary()){&lt;br /&gt;
    op.value(i) = 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At each time step the matrix equation is solved using an Eigen linear equation solver, in this case the BICGStab algorithm, and $rhs$ is updated. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// Solve matrix system.&lt;br /&gt;
psi = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update rhs.&lt;br /&gt;
rhs = psi;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Time propagation of the real part of the solution $\Psi(x,y,t)$ from times 0 to $T=0.63$ is presented below. Time step used was $10^{-5}$.&lt;br /&gt;
&lt;br /&gt;
[[File:video (1).mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
As analytical solutions for infinite potential well are known this enables comparison between analytical and numerical solution computed with Medusa. On the graph bellow the error of the numerical solution is presented as maximal absolute error $e_{\infty}$, meaning the largest absolute difference between numeric and its analytical solution in node at specific time. Expected linear convergence of error on a log - log scale can be observed.&lt;br /&gt;
&lt;br /&gt;
[[File:infinite_well_2D_error.png|400px]]&lt;br /&gt;
[[File:infinite_well_2D_error_fit.png|400px]]&lt;br /&gt;
&lt;br /&gt;
The complete exampe is avalible at [https://gitlab.com/e62Lab/medusa/blob/dev/examples/quantum_mechanics/infinite_well_2D.cpp infinite_well_2D.cpp].&lt;br /&gt;
&lt;br /&gt;
== 3D infinite cubic well ==&lt;br /&gt;
Now we are dealing with a problem very similar to the previous one, the only difference is, that in this case we have a quantum particle in a 3-dimensional box. The equation and the boundary condition &lt;br /&gt;
&lt;br /&gt;
\[&lt;br /&gt;
\nabla^2 \Psi = -i{\partial \over \partial t}\Psi \quad \text{in} \quad \Omega,&lt;br /&gt;
\\&lt;br /&gt;
\Psi = 0 \quad \text{on} \quad \partial \Omega,&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
remain unchanged, merely the domain changes to unit cube, $\Omega=[0, 1]\times[0, 1]\times [0, 1]$. The only step left is to select an initial state of the wave function, we choose&lt;br /&gt;
\[&lt;br /&gt;
\Psi(x,y,t=0) = \sin{(\pi x)} \sin{(\pi y) \sin(\pi z)}.&lt;br /&gt;
\]&lt;br /&gt;
The plot of the real and imaginary part of the solution $\Psi(x, y, z)$ at time $T=0.1$ is shown bellow. &lt;br /&gt;
&lt;br /&gt;
[[File:infinite_well_3D_rsol.png|400px]]&lt;br /&gt;
[[File:infinite_well_3D_csol.png|400px]]&lt;br /&gt;
&lt;br /&gt;
The complete exampe is avalible at [https://gitlab.com/e62Lab/medusa/blob/dev/examples/quantum_mechanics/infinite_well_3D.cpp infinite_well_3D.cpp].&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=Complex-valued_problems&amp;diff=2673</id>
		<title>Complex-valued problems</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=Complex-valued_problems&amp;diff=2673"/>
				<updated>2019-07-19T14:08:16Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
Our library natively supports complex numbers. To demonstrate this a tutorial for solving Poisson's equation is presented below. For more complicated complex-valued problems see [[Electromagnetic scattering]] and [[Schrödinger equation]].&lt;br /&gt;
&lt;br /&gt;
== 2D Complex Poisson's equation ==&lt;br /&gt;
We are solving 2D complex Poisson equation, on a unit square with Dirichlet boundary conditions &lt;br /&gt;
&lt;br /&gt;
\[&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	i \Delta u &amp;amp;= f      &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega,&lt;br /&gt;
\end{align*}&lt;br /&gt;
\]&lt;br /&gt;
where $u(x,y)$ is the solution to the problem and $\Omega = [0, 1] \times [0, 1]$ denotes the square domain. We will consider $f(x,y) = 2\pi^2\sin(\pi x)\sin(\pi y)$, as it makes for &lt;br /&gt;
a simple solution $u(x,y) = i\sin(\pi x)\sin(\pi y)$.&lt;br /&gt;
&lt;br /&gt;
We write the equations for our problem by directly translating the mathematical formulation above into code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
for (int i : domain.interior()) {&lt;br /&gt;
    double x = domain.pos(i, 0);&lt;br /&gt;
    double y = domain.pos(i, 1);&lt;br /&gt;
    1.0_i * op.lap(i) = 2*PI*PI*sin(PI * x)*sin(PI * y);&lt;br /&gt;
}&lt;br /&gt;
for (int i : domain.boundary()) {&lt;br /&gt;
    op.value(i) = 0.0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The solution $u(x,y)$ is plotted below. In our case solution consist only of the imaginary part, the real part is equal to zero. &lt;br /&gt;
&lt;br /&gt;
[[File:complex_poisson_2D_real.png|500px]]&lt;br /&gt;
[[File:complex_poisson_2D_imag.png|500px]]&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=Complex-valued_problems&amp;diff=2672</id>
		<title>Complex-valued problems</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=Complex-valued_problems&amp;diff=2672"/>
				<updated>2019-07-19T14:07:36Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
Our library natively supports complex numbers. To demonstrate this a tutorial for solving Poisson's equation is presented below. For more complicated complex-valued problems see [[Electromagnetic scattering]] and [[Schrödinger equation]].&lt;br /&gt;
&lt;br /&gt;
== 2D Complex Poisson's equation ==&lt;br /&gt;
We are solving 2D complex Poisson equation, on a unit square with Dirichlet boundary conditions &lt;br /&gt;
&lt;br /&gt;
\[&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	i \Delta u &amp;amp;= f      &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega,&lt;br /&gt;
\end{align*}&lt;br /&gt;
\]&lt;br /&gt;
where $u(x,y)$ is the solution to the problem and $\Omega = [0, 1] \times [0, 1]$ denotes the square domain. We will consider $f(x,y) = 2\pi^2\sin(\pi x)\sin(\pi y)$, as it makes for &lt;br /&gt;
a simple solution $u(x,y) = i\sin(\pi x)\sin(\pi y)$.&lt;br /&gt;
&lt;br /&gt;
We write the equations for our problem by directly translating the mathematical formulation above into code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
for (int i : domain.interior()) {&lt;br /&gt;
    double x = domain.pos(i, 0);&lt;br /&gt;
    double y = domain.pos(i, 1);&lt;br /&gt;
    1.0_i * op.lap(i) = -2*PI*PI*sin(PI * x)*sin(PI * y);&lt;br /&gt;
}&lt;br /&gt;
for (int i : domain.boundary()) {&lt;br /&gt;
    op.value(i) = 0.0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The solution $u(x,y)$ is plotted below. In our case solution consist only of the imaginary part, the real part is equal to zero. &lt;br /&gt;
&lt;br /&gt;
[[File:complex_poisson_2D_real.png|500px]]&lt;br /&gt;
[[File:complex_poisson_2D_imag.png|500px]]&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=Complex-valued_problems&amp;diff=2671</id>
		<title>Complex-valued problems</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=Complex-valued_problems&amp;diff=2671"/>
				<updated>2019-07-19T14:04:33Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
Our library natively supports complex numbers. To demonstrate this a simple example of Poisson's equation is presented below. For more complicated complex-valued problems see [[Electromagnetic scattering]] and [[Schrödinger equation]].&lt;br /&gt;
&lt;br /&gt;
== 2D Complex Poisson's equation ==&lt;br /&gt;
We are solving 2D complex Poisson equation, on a unit square with Dirichlet boundary conditions &lt;br /&gt;
&lt;br /&gt;
\[&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	i \Delta u &amp;amp;= f      &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega,&lt;br /&gt;
\end{align*}&lt;br /&gt;
\]&lt;br /&gt;
where $u(x,y)$ is the solution to the problem and $\Omega = [0, 1] \times [0, 1]$ denotes the square domain. We will consider $f(x,y) = 2\pi^2\sin(\pi x)\sin(\pi y)$, as it makes for &lt;br /&gt;
a simple solution $u(x,y) = i\sin(\pi x)\sin(\pi y)$.&lt;br /&gt;
&lt;br /&gt;
We write the equations for our problem by directly translating the mathematical formulation above into code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
for (int i : domain.interior()) {&lt;br /&gt;
    double x = domain.pos(i, 0);&lt;br /&gt;
    double y = domain.pos(i, 1);&lt;br /&gt;
    1.0_i * op.lap(i) = -2*PI*PI*sin(PI * x)*sin(PI * y);&lt;br /&gt;
}&lt;br /&gt;
for (int i : domain.boundary()) {&lt;br /&gt;
    op.value(i) = 0.0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The solution $u(x,y)$ is plotted below. In our case solution consist only of the imaginary part, the real part is equal to zero. &lt;br /&gt;
&lt;br /&gt;
[[File:complex_poisson_2D_real.png|500px]]&lt;br /&gt;
[[File:complex_poisson_2D_imag.png|500px]]&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=File:Complex_poisson_2D_imag.png&amp;diff=2668</id>
		<title>File:Complex poisson 2D imag.png</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=File:Complex_poisson_2D_imag.png&amp;diff=2668"/>
				<updated>2019-07-19T14:03:20Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=File:Complex_poisson_2D_real.png&amp;diff=2666</id>
		<title>File:Complex poisson 2D real.png</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=File:Complex_poisson_2D_real.png&amp;diff=2666"/>
				<updated>2019-07-19T14:03:17Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2658</id>
		<title>Schrödinger equation</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2658"/>
				<updated>2019-07-15T14:35:30Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
== 2D infinite square well ==&lt;br /&gt;
We are solving a Schrödinger equation for a quantum particle that is confined to a 2-dimensional square box, $0&amp;lt;x&amp;lt;L$ and $0&amp;lt;y&amp;lt;L$.  Within this square the particle behaves as a free particle, but the walls are impenetrable, so the wave function  is zero at the walls. This is described by the infinite potential&lt;br /&gt;
&lt;br /&gt;
\[&lt;br /&gt;
V(x)=&lt;br /&gt;
\begin{cases}&lt;br /&gt;
0, &amp;amp;0&amp;lt;x&amp;lt;L,\: 0&amp;lt;y&amp;lt;L,&lt;br /&gt;
\\&lt;br /&gt;
\infty, &amp;amp;{\text{otherwise.}}&lt;br /&gt;
\end{cases}&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
With this potential Schrödinger equation simplifies to &lt;br /&gt;
\[&lt;br /&gt;
-{\hbar^2 \over 2m} \nabla^2 \Psi(x,y,t) = i\hbar {\partial \over \partial t}\Psi(x,y,t),&lt;br /&gt;
\]&lt;br /&gt;
where $m$ is the mass of the particle, $\hbar$ is reduced Planck constant and $\Psi(x,y,t)$ is the wave function. We set $\hbar / 2m = 1$ and $L=1$. &lt;br /&gt;
&lt;br /&gt;
The solution $\Psi(x,y,t)$ must therefore satisfy&lt;br /&gt;
\[&lt;br /&gt;
\nabla^2 \Psi = -i{\partial \over \partial t}\Psi \quad \text{in} \quad \Omega,&lt;br /&gt;
\]&lt;br /&gt;
with Dirichlet boundary condition&lt;br /&gt;
\[&lt;br /&gt;
\Psi = 0 \quad \text{on} \quad \partial \Omega,&lt;br /&gt;
\]&lt;br /&gt;
where $\Omega=[0, 1]\times[0, 1]$ denotes the square box domain and $\partial \Omega$ is the boundary of the domain. In order to get the unique solution for the time propagation of the wave function, the initial state $\Psi(x, y,t= 0)$ has to be selected. We choose &lt;br /&gt;
\[&lt;br /&gt;
\Psi(x,y,t=0) = \sin{(\pi x)} \sin{(\pi y)}.&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
Once we prepare the domain and operators, we can turn the Schrödinger equation into code. As we are solving the time propagation implicitly, we will have to solve a matrix equation for every step. For this reason a space matrix $M$ is constructed. Next the equations are implemented, $psi$ denotes the matrix solution for each step and $rhs$ the right-hand side of the matrix equation, which is in our case equivalent to the previous state $psi$. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;complex&amp;lt;double&amp;gt;, RowMajor&amp;gt; M(N, N);&lt;br /&gt;
&lt;br /&gt;
// Set initial state.&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    double x = domain.pos(i, 0);&lt;br /&gt;
    double y = domain.pos(i, 1);&lt;br /&gt;
    rhs(i) = sin(PI * x) * sin(PI * y);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Set equation on interior.&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    op.value(i) + (-1.0_i) * dt * op.lap(i) = rhs(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Set equation on boundary.&lt;br /&gt;
for (int i: domain.boundary()){&lt;br /&gt;
    op.value(i) = 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At each time step the matrix equation is solved using an Eigen linear equation solver, in this case the BICGStab algorithm, and $rhs$ is updated. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// Solve matrix system.&lt;br /&gt;
psi = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update rhs.&lt;br /&gt;
rhs = psi;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Time propagation of the real part of the solution $\Psi(x,y,t)$ from times 0 to $T=0.63$ is presented below. Time step used was $10^{-5}$.&lt;br /&gt;
&lt;br /&gt;
[[File:video (1).mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
As analytical solutions for infinite potential well are known this enables comparison between analytical and numerical solution computed with Medusa. On the graph bellow the error of the numerical solution is presented as maximal absolute error $e_{\infty}$, meaning the largest absolute difference between numeric and its analytical solution in node at specific time. Expected linear convergence of error on a log - log scale can be observed.&lt;br /&gt;
&lt;br /&gt;
[[File:infinite_well_2D_error.png|400px]]&lt;br /&gt;
[[File:infinite_well_2D_error_fit.png|400px]]&lt;br /&gt;
&lt;br /&gt;
== 3D infinite cubic well ==&lt;br /&gt;
Now we are dealing with a problem very similar to the previous one, the only difference is, that in this case we have a quantum particle in a 3-dimensional box. The equation and the boundary condition &lt;br /&gt;
&lt;br /&gt;
\[&lt;br /&gt;
\nabla^2 \Psi = -i{\partial \over \partial t}\Psi \quad \text{in} \quad \Omega,&lt;br /&gt;
\\&lt;br /&gt;
\Psi = 0 \quad \text{on} \quad \partial \Omega,&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
remain unchanged, merely the domain changes to unit cube, $\Omega=[0, 1]\times[0, 1]\times [0, 1]$. The only step left is to select an initial state of the wave function, we choose&lt;br /&gt;
\[&lt;br /&gt;
\Psi(x,y,t=0) = \sin{(\pi x)} \sin{(\pi y) \sin(\pi z)}.&lt;br /&gt;
\]&lt;br /&gt;
The plot of the real and imaginary part of the solution $\Psi(x, y, z)$ at time $T=0.1$ is shown bellow. &lt;br /&gt;
&lt;br /&gt;
[[File:infinite_well_3D_rsol.png|400px]]&lt;br /&gt;
[[File:infinite_well_3D_csol.png|400px]]&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2657</id>
		<title>Schrödinger equation</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2657"/>
				<updated>2019-07-15T14:21:31Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D infinite square well ==&lt;br /&gt;
We are solving a Schrödinger equation for a quantum particle that is confined to a 2-dimensional square box, $0&amp;lt;x&amp;lt;L$ and $0&amp;lt;y&amp;lt;L$.  Within this square the particle behaves as a free particle, but the walls are impenetrable, so the wave function  is zero at the walls. This is described by the infinite potential&lt;br /&gt;
&lt;br /&gt;
\[&lt;br /&gt;
V(x)=&lt;br /&gt;
\begin{cases}&lt;br /&gt;
0, &amp;amp;0&amp;lt;x&amp;lt;L,\: 0&amp;lt;y&amp;lt;L,&lt;br /&gt;
\\&lt;br /&gt;
\infty, &amp;amp;{\text{otherwise.}}&lt;br /&gt;
\end{cases}&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
With this potential Schrödinger equation simplifies to &lt;br /&gt;
\[&lt;br /&gt;
-{\hbar^2 \over 2m} \nabla^2 \Psi(x,y,t) = i\hbar {\partial \over \partial t}\Psi(x,y,t),&lt;br /&gt;
\]&lt;br /&gt;
where $m$ is the mass of the particle, $\hbar$ is reduced Planck constant and $\Psi(x,y,t)$ is the wave function. We set $\hbar / 2m = 1$ and $L=1$. &lt;br /&gt;
&lt;br /&gt;
The solution $\Psi(x,y,t)$ must therefore satisfy&lt;br /&gt;
\[&lt;br /&gt;
\nabla^2 \Psi = -i{\partial \over \partial t}\Psi \quad \text{in} \quad \Omega,&lt;br /&gt;
\]&lt;br /&gt;
with Dirichlet boundary condition&lt;br /&gt;
\[&lt;br /&gt;
\Psi = 0 \quad \text{on} \quad \partial \Omega,&lt;br /&gt;
\]&lt;br /&gt;
where $\Omega=[0, 1]\times[0, 1]$ denotes the square box domain and $\partial \Omega$ is the boundary of the domain. In order to get the unique solution for the time propagation of the wave function, the initial state $\Psi(x, y,t= 0)$ has to be selected. We choose &lt;br /&gt;
\[&lt;br /&gt;
\Psi(x,y,t=0) = \sin{(\pi x)} \sin{(\pi y)}.&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
Once we prepare the domain and operators, we can turn the Schrödinger equation into code. As we are solving the time propagation implicitly, we will have to solve a matrix equation for every step. For this reason a space matrix $M$ is constructed. Next the equations are implemented, $psi$ denotes the matrix solution for each step and $rhs$ the right-hand side of the matrix equation, which is in our case equivalent to the previous state $psi$. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;complex&amp;lt;double&amp;gt;, RowMajor&amp;gt; M(N, N);&lt;br /&gt;
&lt;br /&gt;
// Set initial state.&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    double x = domain.pos(i, 0);&lt;br /&gt;
    double y = domain.pos(i, 1);&lt;br /&gt;
    rhs(i) = sin(PI * x) * sin(PI * y);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Set equation on interior.&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    op.value(i) + (-1.0_i) * dt * op.lap(i) = rhs(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Set equation on boundary.&lt;br /&gt;
for (int i: domain.boundary()){&lt;br /&gt;
    op.value(i) = 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At each time step the matrix equation is solved using an Eigen linear equation solver, in this case the BICGStab algorithm, and $rhs$ is updated. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// Solve matrix system.&lt;br /&gt;
psi = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update rhs.&lt;br /&gt;
rhs = psi;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Time propagation of the real part of the solution $\Psi(x,y,t)$ from times 0 to $T=0.63$ is presented below. Time step used was $10^{-5}$.&lt;br /&gt;
&lt;br /&gt;
[[File:video (1).mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
As analytical solutions for infinite potential well are known this enables comparison between analytical and numerical solution computed with Medusa. On the graph bellow the error of the numerical solution is presented as maximal absolute error $e_{\infty}$, meaning the largest absolute difference between numeric and its analytical solution in node at specific time. Expected linear convergence of error on a log - log scale can be observed.&lt;br /&gt;
&lt;br /&gt;
[[File:infinite_well_2D_error.png|400px]]&lt;br /&gt;
[[File:infinite_well_2D_error_fit.png|400px]]&lt;br /&gt;
&lt;br /&gt;
== 3D infinite cubic well ==&lt;br /&gt;
Now we are dealing with a problem very similar to the previous one, the only difference is, that in this case we have a quantum particle in a 3-dimensional box. The equation and the boundary condition &lt;br /&gt;
&lt;br /&gt;
\[&lt;br /&gt;
\nabla^2 \Psi = -i{\partial \over \partial t}\Psi \quad \text{in} \quad \Omega,&lt;br /&gt;
\\&lt;br /&gt;
\Psi = 0 \quad \text{on} \quad \partial \Omega,&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
remain unchanged, only the domain changes to unit cube, $\Omega=[0, 1]\times[0, 1]\times [0, 1]$.&lt;br /&gt;
For initial state $\Psi(x, y, z,t= 0)$ we choose &lt;br /&gt;
\[&lt;br /&gt;
\Psi(x,y,t=0) = \sin{(\pi x)} \sin{(\pi y) \sin(\pi z)}.&lt;br /&gt;
\]&lt;br /&gt;
The plot of the real and imaginary part of the solution $\Psi(x, y, z)$ at time $T=0.1$ is presented bellow. &lt;br /&gt;
&lt;br /&gt;
[[File:infinite_well_3D_rsol.png|400px]]&lt;br /&gt;
[[File:infinite_well_3D_csol.png|400px]]&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2656</id>
		<title>Schrödinger equation</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2656"/>
				<updated>2019-07-15T14:19:00Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D infinite square well ==&lt;br /&gt;
We are solving a Schrödinger equation for a quantum particle that is confined to a 2-dimensional square box, $0&amp;lt;x&amp;lt;L$ and $0&amp;lt;y&amp;lt;L$.  Within this square the particle behaves as a free particle, but the walls are impenetrable, so the wave function  is zero at the walls. This is described by the infinite potential&lt;br /&gt;
&lt;br /&gt;
\[&lt;br /&gt;
V(x)=&lt;br /&gt;
\begin{cases}&lt;br /&gt;
0, &amp;amp;0&amp;lt;x&amp;lt;L,\: 0&amp;lt;y&amp;lt;L,&lt;br /&gt;
\\&lt;br /&gt;
\infty, &amp;amp;{\text{otherwise.}}&lt;br /&gt;
\end{cases}&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
With this potential Schrödinger equation simplifies to &lt;br /&gt;
\[&lt;br /&gt;
-{\hbar^2 \over 2m} \nabla^2 \Psi(x,y,t) = i\hbar {\partial \over \partial t}\Psi(x,y,t),&lt;br /&gt;
\]&lt;br /&gt;
where $m$ is the mass of the particle, $\hbar$ is reduced Planck constant and $\Psi(x,y,t)$ is the wave function. We set $\hbar / 2m = 1$ and $L=1$. &lt;br /&gt;
&lt;br /&gt;
The solution $\Psi(x,y,t)$ must therefore satisfy&lt;br /&gt;
\[&lt;br /&gt;
\nabla^2 \Psi = -i{\partial \over \partial t}\Psi \quad \text{in} \quad \Omega,&lt;br /&gt;
\]&lt;br /&gt;
with Dirichlet boundary condition&lt;br /&gt;
\[&lt;br /&gt;
\Psi = 0 \quad \text{on} \quad \partial \Omega,&lt;br /&gt;
\]&lt;br /&gt;
where $\Omega=[0, 1]\times[0, 1]$ denotes the square box domain and $\partial \Omega$ is the boundary of the domain. In order to get the unique solution for the time propagation of the wave function, the initial state $\Psi(x, y,t= 0)$ has to be selected. We choose &lt;br /&gt;
\[&lt;br /&gt;
\Psi(x,y,t=0) = \sin{(\pi x)} \sin{(\pi y)}.&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
Once we prepare the domain and operators, we can turn the Schrödinger equation into code. As we are solving the time propagation implicitly, we will have to solve a matrix equation for every step. For this reason a space matrix $M$ is constructed. Next the equations are implemented, $psi$ denotes the matrix solution for each step and $rhs$ the right-hand side of the matrix equation, which is in our case equivalent to the previous state $psi$. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;complex&amp;lt;double&amp;gt;, RowMajor&amp;gt; M(N, N);&lt;br /&gt;
&lt;br /&gt;
// Set initial state.&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    double x = domain.pos(i, 0);&lt;br /&gt;
    double y = domain.pos(i, 1);&lt;br /&gt;
    rhs(i) = sin(PI * x) * sin(PI * y);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Set equation on interior.&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    op.value(i) + (-1.0_i) * dt * op.lap(i) = rhs(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Set equation on boundary.&lt;br /&gt;
for (int i: domain.boundary()){&lt;br /&gt;
    op.value(i) = 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At each time step the matrix equation is solved using an Eigen linear equation solver, in this case the BICGStab algorithm, and $rhs$ is updated. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// Solve matrix system.&lt;br /&gt;
psi = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update rhs.&lt;br /&gt;
rhs = psi;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Time propagation of the real part of the solution $\Psi(x,y,t)$ from times 0 to $T=0.63$ is presented below. Time step used was $10^{-5}$.&lt;br /&gt;
&lt;br /&gt;
[[File:video (1).mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
As analytical solutions for infinite potential well are known this enables comparison between analytical and numerical solution computed with Medusa. On the graph bellow the error of the numerical solution is presented as maximal absolute error $e_{\infty}$, meaning the largest absolute difference between numeric and its analytical solution in node at specific time. Expected linear convergence of error on a log - log scale can be observed.&lt;br /&gt;
&lt;br /&gt;
[[File:infinite_well_2D_error.png|400px]]&lt;br /&gt;
[[File:infinite_well_2D_error_fit.png|400px]]&lt;br /&gt;
&lt;br /&gt;
== 3D infinite cubic well ==&lt;br /&gt;
Now we are dealing with a problem very similar to the previus one, the only diffrenece is, that in this case we have a quantom particle in a 3-dimensional box. Equation and the boundary condition &lt;br /&gt;
&lt;br /&gt;
\[&lt;br /&gt;
\nabla^2 \Psi = -i{\partial \over \partial t}\Psi \quad \text{in} \quad \Omega,&lt;br /&gt;
\\&lt;br /&gt;
\Psi = 0 \quad \text{on} \quad \partial \Omega,&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
remain unchanged, only the domain changes to unit cube, $\Omega=[0, 1]\times[0, 1]\times [0, 1]$.&lt;br /&gt;
For initial state $\Psi(x, y, z,t= 0)$ we choose &lt;br /&gt;
\[&lt;br /&gt;
\Psi(x,y,t=0) = \sin{(\pi x)} \sin{(\pi y) \sin(\piz)}.&lt;br /&gt;
\]&lt;br /&gt;
The plot of the real and imaginary part of the solution $\Psi(x, y, z)$ at time $T=0.1$ is plotted bellow. &lt;br /&gt;
&lt;br /&gt;
[[File:infinite_well_3D_rsol.png|400px]]&lt;br /&gt;
[[File:infinite_well_3D_csol.png|400px]]&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=File:Infinite_well_3D_csol.png&amp;diff=2655</id>
		<title>File:Infinite well 3D csol.png</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=File:Infinite_well_3D_csol.png&amp;diff=2655"/>
				<updated>2019-07-15T14:18:33Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=File:Infinite_well_3D_rsol.png&amp;diff=2654</id>
		<title>File:Infinite well 3D rsol.png</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=File:Infinite_well_3D_rsol.png&amp;diff=2654"/>
				<updated>2019-07-15T14:18:31Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2653</id>
		<title>Schrödinger equation</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2653"/>
				<updated>2019-07-15T13:17:39Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D infinite square well ==&lt;br /&gt;
We are solving a Schrödinger equation for a quantum particle that is confined to a 2-dimensional square box, $0&amp;lt;x&amp;lt;L$ and $0&amp;lt;y&amp;lt;L$.  Within this square the particle behaves as a free particle, but the walls are impenetrable, so the wave function  is zero at the walls. This is described by the infinite potential&lt;br /&gt;
&lt;br /&gt;
\[&lt;br /&gt;
V(x)=&lt;br /&gt;
\begin{cases}&lt;br /&gt;
0, &amp;amp;0&amp;lt;x&amp;lt;L,\: 0&amp;lt;y&amp;lt;L,&lt;br /&gt;
\\&lt;br /&gt;
\infty, &amp;amp;{\text{otherwise.}}&lt;br /&gt;
\end{cases}&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
With this potential Schrödinger equation simplifies to &lt;br /&gt;
\[&lt;br /&gt;
-{\hbar^2 \over 2m} \nabla^2 \Psi(x,y,t) = i\hbar {\partial \over \partial t}\Psi(x,y,t),&lt;br /&gt;
\]&lt;br /&gt;
where $m$ is the mass of the particle, $\hbar$ is reduced Planck constant and $\Psi(x,y,t)$ is the wave function. We set $\hbar / 2m = 1$ and $L=1$. &lt;br /&gt;
&lt;br /&gt;
The solution $\Psi(x,y,t)$ must therefore satisfy&lt;br /&gt;
\[&lt;br /&gt;
\nabla^2 \Psi = -i{\partial \over \partial t}\Psi \quad \text{in} \quad \Omega,&lt;br /&gt;
\]&lt;br /&gt;
with Dirichlet boundary condition&lt;br /&gt;
\[&lt;br /&gt;
\Psi = 0 \quad \text{on} \quad \partial \Omega,&lt;br /&gt;
\]&lt;br /&gt;
where $\Omega=[0, 1]\times[0, 1]$ denotes the square box domain and $\partial \Omega$ is the boundary of the domain. In order to get the unique solution for the time propagation of the wave function, the initial state $\Psi(x, y,t= 0)$ has to be selected. We choose &lt;br /&gt;
\[&lt;br /&gt;
\Psi(x,y,t=0) = \sin{(\pi x)} \sin{(\pi y)}.&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
Once we prepare the domain and operators, we can turn the Schrödinger equation into code. As we are solving the time propagation implicitly, we will have to solve a matrix equation for every step. For this reason a space matrix $M$ is constructed. Next the equations are implemented, $psi$ denotes the matrix solution for each step and $rhs$ the right-hand side of the matrix equation, which is in our case equivalent to the previous state $psi$. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;complex&amp;lt;double&amp;gt;, RowMajor&amp;gt; M(N, N);&lt;br /&gt;
&lt;br /&gt;
// Set initial state.&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    double x = domain.pos(i, 0);&lt;br /&gt;
    double y = domain.pos(i, 1);&lt;br /&gt;
    rhs(i) = sin(PI * x) * sin(PI * y);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Set equation on interior.&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    op.value(i) + (-1.0_i) * dt * op.lap(i) = rhs(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Set equation on boundary.&lt;br /&gt;
for (int i: domain.boundary()){&lt;br /&gt;
    op.value(i) = 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At each time step the matrix equation is solved using an Eigen linear equation solver, in this case the BICGStab algorithm, and $rhs$ is updated. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// Solve matrix system.&lt;br /&gt;
psi = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update rhs.&lt;br /&gt;
rhs = psi;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Time propagation of the real part of the solution $\Psi(x,y,t)$ from times 0 to $T=0.63$ is presented below. Time step used was $10^{-5}$.&lt;br /&gt;
&lt;br /&gt;
[[File:video (1).mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
As analytical solutions for infinite potential well are known this enables comparison between analytical and numerical solution computed with Medusa. On the graph bellow the error of the numerical solution is presented as maximal absolute error $e_{\infty}$, meaning the largest absolute difference between numeric and its analytical solution in node at specific time. Expected linear convergence of error on a log - log scale can be observed.&lt;br /&gt;
&lt;br /&gt;
[[File:infinite_well_2D_error.png|400px]]&lt;br /&gt;
[[File:infinite_well_2D_error_fit.png|400px]]&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=File:Infinite_well_2D_error_fit.png&amp;diff=2652</id>
		<title>File:Infinite well 2D error fit.png</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=File:Infinite_well_2D_error_fit.png&amp;diff=2652"/>
				<updated>2019-07-15T13:15:54Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=File:Infinite_well_2D_error.png&amp;diff=2651</id>
		<title>File:Infinite well 2D error.png</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=File:Infinite_well_2D_error.png&amp;diff=2651"/>
				<updated>2019-07-15T13:15:53Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=File:2D_xerr_convergence_monomi_1.pdf&amp;diff=2650</id>
		<title>File:2D xerr convergence monomi 1.pdf</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=File:2D_xerr_convergence_monomi_1.pdf&amp;diff=2650"/>
				<updated>2019-07-15T13:07:05Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=File:2D_fit_monomials_1.pdf&amp;diff=2649</id>
		<title>File:2D fit monomials 1.pdf</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=File:2D_fit_monomials_1.pdf&amp;diff=2649"/>
				<updated>2019-07-15T13:07:03Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2629</id>
		<title>Schrödinger equation</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2629"/>
				<updated>2019-06-17T20:33:35Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D infinite square well ==&lt;br /&gt;
We are solving a Schrödinger equation for a quantum particle that is confined to a 2-dimensional square box, $0&amp;lt;x&amp;lt;L$ and $0&amp;lt;y&amp;lt;L$.  Within this square the particle behaves as a free particle, but the walls are impenetrable, so the wave function  is zero at the walls. This is described by the infinite potential&lt;br /&gt;
&lt;br /&gt;
\[&lt;br /&gt;
V(x)=&lt;br /&gt;
\begin{cases}&lt;br /&gt;
0, &amp;amp;0&amp;lt;x&amp;lt;L,\: 0&amp;lt;y&amp;lt;L,&lt;br /&gt;
\\&lt;br /&gt;
\infty, &amp;amp;{\text{otherwise.}}&lt;br /&gt;
\end{cases}&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
With this potential Schrodinger equation simplifies to &lt;br /&gt;
\[&lt;br /&gt;
-{\hbar^2 \over 2m} \nabla^2 \Psi(x,y,t) = i\hbar {\partial \over \partial t}\Psi(x,y,t),&lt;br /&gt;
\]&lt;br /&gt;
where $m$ is the mass of the particle, $\hbar$ is reduced Planck constant and $\Psi(x,y,t)$ is the wave function. We set $\hbar / 2m = 1$ and $L=1$. &lt;br /&gt;
&lt;br /&gt;
The solution $\Psi(x,y,t)$ must therefore satisfy&lt;br /&gt;
\[&lt;br /&gt;
\nabla^2 \Psi = -i{\partial \over \partial t}\Psi \quad \text{in} \quad \Omega,&lt;br /&gt;
\]&lt;br /&gt;
with Dirichlet boundary condition&lt;br /&gt;
\[&lt;br /&gt;
\Psi = 0 \quad \text{on} \quad \partial \Omega,&lt;br /&gt;
\]&lt;br /&gt;
where $\Omega=[0, 1]\times[0, 1]$ denotes the square box domain and $\partial \Omega$ is the boundary of the domain. In order to get the unique solution for the time propagation of the wave function the initial state $\Psi(x, y,t= 0)$ has to be selected. We choose &lt;br /&gt;
\[&lt;br /&gt;
\Psi(x,y,t=0) = \sin{(\pi x)} \sin{(\pi y)}.&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
Once we prepare the domain and operators, we can turn the Schrodinger equation into code. As we are solving the time propagation implicitly, we will have to solve a matrix equation for every step. For this reason a space matrix $M$ is constructed. Next the equations are implemented, $psi$ denotes the matrix solution for each step and $rhs$ the right-hand side of the matrix equation which is in our case equivalent to the previous state $psi$ . &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
Eigen::SparseMatrix&amp;lt;std::complex&amp;lt;double&amp;gt;, Eigen::RowMajor&amp;gt; M(N, N);&lt;br /&gt;
&lt;br /&gt;
// set initial state&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    double x = domain.pos(i, 0);&lt;br /&gt;
    double y = domain.pos(i, 1);&lt;br /&gt;
    rhs(i) = sin(PI * x) * sin(PI * y);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// set equation on interior&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    op.value(i) + (-1.0i) * dt * op.lap(i) = rhs(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// set equation on boundary&lt;br /&gt;
for (int i: domain.boundary()){&lt;br /&gt;
    op.value(i) = 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At each time step the matrix equation is solved using an Eigen linear equation solver, in this case, the BICGStab algorithm, and $rhs$ is updated. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// solve matrix system&lt;br /&gt;
psi = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// update rhs&lt;br /&gt;
rhs = psi;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Time propagation of the real part of the solution $\Psi(x,y; t)$ from times 0 to $T=0.63$ is presented below. Time step used was $10^{-5}$.&lt;br /&gt;
&lt;br /&gt;
[[File:video (1).mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
As analytical solutions for infinite potential well are known this enables comparison between analytical and numerical solution computed with Medusa. On the graph bellow the error of the numerical solution is presented as maximal absolute error, meaning the largest absolute difference between numeric and its analytical solution in node at specific time. Expected linear convergence of error on a log - log scale can be observed.&lt;br /&gt;
&lt;br /&gt;
[[File:infinite_well_2D_convergence.png|400px]]&lt;br /&gt;
[[File:infinite_well_2D_convergence_fit.png|400px]]&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2628</id>
		<title>Schrödinger equation</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2628"/>
				<updated>2019-06-17T20:32:14Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D infinite square well ==&lt;br /&gt;
We are solving a Schrödinger equation for a quantum particle that is confined to a 2-dimensional square box, $0&amp;lt;x&amp;lt;L$ and $0&amp;lt;y&amp;lt;L$.  Within this square the particle behaves as a free particle, but the walls are impenetrable, so the wave function  is zero at the walls. This is described by the infinite potential&lt;br /&gt;
&lt;br /&gt;
\[&lt;br /&gt;
V(x)=&lt;br /&gt;
\begin{cases}&lt;br /&gt;
0, &amp;amp;0&amp;lt;x&amp;lt;L,\: 0&amp;lt;y&amp;lt;L,&lt;br /&gt;
\\&lt;br /&gt;
\infty, &amp;amp;{\text{otherwise.}}&lt;br /&gt;
\end{cases}&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
With this potential Schrodinger equation simplifies to &lt;br /&gt;
\[&lt;br /&gt;
-{\hbar^2 \over 2m} \nabla^2 \Psi(x,y,t) = i\hbar {\partial \over \partial t}\Psi(x,y,t),&lt;br /&gt;
\]&lt;br /&gt;
where $m$ is the mass of the particle, $\hbar$ is reduced Planck constant and $\Psi(x,y,t)$ is the wave function. We set $\hbar / 2m = 1$ and $L=1$. &lt;br /&gt;
&lt;br /&gt;
The solution $\Psi(x,y,t)$ must therefore satisfy&lt;br /&gt;
\[&lt;br /&gt;
\nabla^2 \Psi = -i{\partial \over \partial t}\Psi \quad \text{in} \quad \Omega,&lt;br /&gt;
\]&lt;br /&gt;
with Dirichlet boundary condition&lt;br /&gt;
\[&lt;br /&gt;
\Psi = 0 \quad \text{on} \quad \partial \Omega,&lt;br /&gt;
\]&lt;br /&gt;
where $\Omega=[0, 1]\times[0, 1]$ denotes the square box domain and $\partial \Omega$ is the boundary of the domain. In order to get the unique solution for the time propagation of the wave function the initial state $\Psi(x, y,t= 0)$ has to be selected. We choose &lt;br /&gt;
\[&lt;br /&gt;
\Psi(x,y,t=0) = \sin{(\pi x)} \sin{(\pi y)}.&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
Once we prepare the domain and operators, we can turn the Schrodinger equation into code. As we are solving the time propagation implicitly, we will have to solve a matrix equation for every step. For this reason a space matrix $M$ is constructed. Next the equations are implemented, $psi$ denotes the matrix solution for each step and $rhs$ the right-hand side of the matrix equation which is in our case equivalent to the previous state $psi$ . &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
Eigen::SparseMatrix&amp;lt;std::complex&amp;lt;double&amp;gt;, Eigen::RowMajor&amp;gt; M(N, N);&lt;br /&gt;
&lt;br /&gt;
// set initial state&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    double x = domain.pos(i, 0);&lt;br /&gt;
    double y = domain.pos(i, 1);&lt;br /&gt;
    rhs(i) = sin(PI * x) * sin(PI * y);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// set equation on interior&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    op.value(i) + (-1.0i) * dt * op.lap(i) = rhs(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// set equation on boundary&lt;br /&gt;
for (int i: domain.boundary()){&lt;br /&gt;
    op.value(i) = 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At each time step the matrix equation is solved using an Eigen linear equation solver, in this case, the BICGStab algorithm, and $rhs$ is updated. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// solve matrix system&lt;br /&gt;
psi = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// update rhs&lt;br /&gt;
rhs = psi;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Time propagation of the real part of the solution \Psi(x,y; t)$ from times 0 to $T=0.63$ is presented below. Time step used was $10^{-5}$.&lt;br /&gt;
&lt;br /&gt;
[[File:video (1).mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
As analytical solutions for infinite potential well are known this enables comparison between analytical and numerical solution computed with Medusa. On the graph bellow the error of the numerical solution is presented as maximal absolute error, meaning the largest absolute difference between numeric and its analytical solution in node at specific time. Expected linear convergence of error on a log - log scale can be observed.&lt;br /&gt;
&lt;br /&gt;
[[File:infinite_well_2D_convergence.png|400px]]&lt;br /&gt;
[[File:infinite_well_2D_convergence_fit.png|400px]]&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=File:Infinite_well_2D_convergence_fit.png&amp;diff=2627</id>
		<title>File:Infinite well 2D convergence fit.png</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=File:Infinite_well_2D_convergence_fit.png&amp;diff=2627"/>
				<updated>2019-06-17T20:31:04Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=File:Infinite_well_2D_convergence.png&amp;diff=2626</id>
		<title>File:Infinite well 2D convergence.png</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=File:Infinite_well_2D_convergence.png&amp;diff=2626"/>
				<updated>2019-06-17T20:30:02Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2625</id>
		<title>Schrödinger equation</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2625"/>
				<updated>2019-06-17T20:22:53Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D infinite square well ==&lt;br /&gt;
We are solving a Schrödinger equation for a quantum particle that is confined to a 2-dimensional square box, $0&amp;lt;x&amp;lt;L$ and $0&amp;lt;y&amp;lt;L$.  Within this square the particle behaves as a free particle, but the walls are impenetrable, so the wave function  is zero at the walls. This is described by the infinite potential&lt;br /&gt;
&lt;br /&gt;
\[&lt;br /&gt;
V(x)=&lt;br /&gt;
\begin{cases}&lt;br /&gt;
0, &amp;amp;0&amp;lt;x&amp;lt;L,\: 0&amp;lt;y&amp;lt;L,&lt;br /&gt;
\\&lt;br /&gt;
\infty, &amp;amp;{\text{otherwise.}}&lt;br /&gt;
\end{cases}&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
With this potential Schrodinger equation simplifies to &lt;br /&gt;
\[&lt;br /&gt;
-{\hbar^2 \over 2m} \nabla^2 \Psi(x,y,t) = i\hbar {\partial \over \partial t}\Psi(x,y,t),&lt;br /&gt;
\]&lt;br /&gt;
where $m$ is the mass of the particle, $\hbar$ is reduced Planck constant and $\Psi(x,y,t)$ is the wave function. We set $\hbar / 2m = 1$ and $L=1$. &lt;br /&gt;
&lt;br /&gt;
The solution $\Psi(x,y,t)$ must therefore satisfy&lt;br /&gt;
\[&lt;br /&gt;
\nabla^2 \Psi = -i{\partial \over \partial t}\Psi \quad \text{in} \quad \Omega,&lt;br /&gt;
\]&lt;br /&gt;
with Dirichlet boundary condition&lt;br /&gt;
\[&lt;br /&gt;
\Psi = 0 \quad \text{on} \quad \partial \Omega,&lt;br /&gt;
\]&lt;br /&gt;
where $\Omega=[0, 1]\times[0, 1]$ denotes the square box domain and $\partial \Omega$ is the boundary of the domain. In order to get the unique solution for the time propagation of the wave function the initial state $\Psi(x, y,t= 0)$ has to be selected. We choose &lt;br /&gt;
\[&lt;br /&gt;
\Psi(x,y,t=0) = \sin{(\pi x)} \sin{(\pi y)}.&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
Once we prepare the domain and operators, we can turn the Schrodinger equation into code. As we are solving the time propagation implicitly, we will have to solve a matrix equation for every step. For this reason a space matrix $M$ is constructed. Next the equations are implemented, $psi$ denotes the matrix solution for each step and $rhs$ the right-hand side of the matrix equation which is in our case equivalent to the previous state $psi$ . &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
Eigen::SparseMatrix&amp;lt;std::complex&amp;lt;double&amp;gt;, Eigen::RowMajor&amp;gt; M(N, N);&lt;br /&gt;
&lt;br /&gt;
// set initial state&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    double x = domain.pos(i, 0);&lt;br /&gt;
    double y = domain.pos(i, 1);&lt;br /&gt;
    rhs(i) = sin(PI * x) * sin(PI * y);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// set equation on interior&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    op.value(i) + (-1.0i) * dt * op.lap(i) = rhs(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// set equation on boundary&lt;br /&gt;
for (int i: domain.boundary()){&lt;br /&gt;
    op.value(i) = 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At each time step the matrix equation is solved using an Eigen linear equation solver, in this case, the BICGStab algorithm, and $rhs$ is updated. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// solve matrix system&lt;br /&gt;
psi = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// update rhs&lt;br /&gt;
rhs = psi;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Time propagation of the real part of the solution \Psi(x,y; t)$ from times 0 to $T=0.63$ is presented below. Time step used was $10^{-5}$.&lt;br /&gt;
&lt;br /&gt;
[[File:video (1).mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
As analytical solutions for infinite potential well are known this enables comparison between analytical and numerical solution computed with Medusa. On the graph bellow the error of the numerical solution is presented as maximal absolute error, meaning the largest absolute difference between numeric and its analytical solution in node at specific time. Expected linear convergence of error on a log - log scale can be observed.&lt;br /&gt;
&lt;br /&gt;
[[File:infinite_well_2D_convergence_fit.pdf|400px]]&lt;br /&gt;
[[File:infinite_well_2D_xerr_convergence.pdf|400px]]&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=File:Infinite_well_2D_xerr_convergence.pdf&amp;diff=2624</id>
		<title>File:Infinite well 2D xerr convergence.pdf</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=File:Infinite_well_2D_xerr_convergence.pdf&amp;diff=2624"/>
				<updated>2019-06-17T20:21:29Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=File:Infinite_well_2D_convergence_fit.pdf&amp;diff=2623</id>
		<title>File:Infinite well 2D convergence fit.pdf</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=File:Infinite_well_2D_convergence_fit.pdf&amp;diff=2623"/>
				<updated>2019-06-17T20:21:28Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2622</id>
		<title>Schrödinger equation</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2622"/>
				<updated>2019-06-17T09:44:43Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D infinite square well ==&lt;br /&gt;
We are solving a Schrödinger equation for a quantum particle that is confined to a 2-dimensional square box, $0&amp;lt;x&amp;lt;L$ and $0&amp;lt;y&amp;lt;L$.  Within this square the particle behaves as a free particle, but the walls are impenetrable, so the wave function  is zero at the walls. This is described by the infinite potential&lt;br /&gt;
&lt;br /&gt;
\[&lt;br /&gt;
V(x)=&lt;br /&gt;
\begin{cases}&lt;br /&gt;
0, &amp;amp;0&amp;lt;x&amp;lt;L,\: 0&amp;lt;y&amp;lt;L,&lt;br /&gt;
\\&lt;br /&gt;
\infty, &amp;amp;{\text{otherwise.}}&lt;br /&gt;
\end{cases}&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
With this potential Schrodinger equation simplifies to &lt;br /&gt;
\[&lt;br /&gt;
-{\hbar^2 \over 2m} \nabla^2 \Psi(x,y,t) = i\hbar {\partial \over \partial t}\Psi(x,y,t),&lt;br /&gt;
\]&lt;br /&gt;
where $m$ is the mass of the particle, $\hbar$ is reduced Planck constant and $\Psi(x,y,t)$ is the wave function. We set $\hbar / 2m = 1$ and $L=1$. &lt;br /&gt;
&lt;br /&gt;
The solution $\Psi(x,y,t)$ must therefore satisfy&lt;br /&gt;
\[&lt;br /&gt;
\nabla^2 \Psi = -i{\partial \over \partial t}\Psi \quad \text{in} \quad \Omega,&lt;br /&gt;
\]&lt;br /&gt;
with Dirichlet boundary condition&lt;br /&gt;
\[&lt;br /&gt;
\Psi = 0 \quad \text{on} \quad \partial \Omega,&lt;br /&gt;
\]&lt;br /&gt;
where $\Omega=[0, 1]\times[0, 1]$ denotes the square box domain and $\partial \Omega$ is the boundary of the domain. In order to get the unique solution for the time propagation of the wave function the initial state $\Psi(x, y,t= 0)$ has to be selected. We choose &lt;br /&gt;
\[&lt;br /&gt;
\Psi(x,y,t=0) = \sin{(\pi x)} \sin{(\pi y)}.&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
Once we prepare the domain and operators, we can turn the Schrodinger equation into code. As we are solving the time propagation implicitly, we will have to solve a matrix equation for every step. For this reason a space matrix $M$ is constructed. Next the equations are implemented, $psi$ denotes the matrix solution for each step and $rhs$ the right-hand side of the matrix equation which is in our case equivalent to the previous state $psi$ . &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
Eigen::SparseMatrix&amp;lt;std::complex&amp;lt;double&amp;gt;, Eigen::RowMajor&amp;gt; M(N, N);&lt;br /&gt;
// set initial state&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    double x = domain.pos(i, 0);&lt;br /&gt;
    double y = domain.pos(i, 1);&lt;br /&gt;
    rhs(i) = sin(PI * x) * sin(PI * y);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// set equation on interior&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    op.value(i) + (-1.0i) * dt * op.lap(i) = rhs(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// set equation on boundary&lt;br /&gt;
for (int i: domain.boundary()){&lt;br /&gt;
    op.value(i) = 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At each time step the matrix equation is solved using an Eigen linear equation solver, in this case, the BICGStab algorithm, and $rhs$ is updated. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// solve matrix system&lt;br /&gt;
psi = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// update rhs&lt;br /&gt;
rhs = psi;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The animation of the real part of solution $\Re \Psi(x,y)$ is presented below.&lt;br /&gt;
&lt;br /&gt;
[[File:video (1).mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2621</id>
		<title>Schrödinger equation</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2621"/>
				<updated>2019-06-17T09:39:21Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D infinite square well ==&lt;br /&gt;
We are solving a Schrödinger equation for a quantum particle that is confined to a 2-dimensional square box, $0&amp;lt;x&amp;lt;L$ and $0&amp;lt;y&amp;lt;L$.  Within this square the particle behaves as a free particle, but the walls are impenetrable, so the wave function  is zero at the walls. This is described by the infinite potential&lt;br /&gt;
&lt;br /&gt;
\[&lt;br /&gt;
V(x)=&lt;br /&gt;
\begin{cases}&lt;br /&gt;
0, &amp;amp;0&amp;lt;x&amp;lt;L,\: 0&amp;lt;y&amp;lt;L,&lt;br /&gt;
\\&lt;br /&gt;
\infty, &amp;amp;{\text{otherwise.}}&lt;br /&gt;
\end{cases}&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
With this potential Schrodinger equation simplifies to &lt;br /&gt;
\[&lt;br /&gt;
-{\hbar^2 \over 2m} \nabla^2 \Psi(x,y;t) = i\hbar {\partial \over \partial t}\Psi(x,y;t),&lt;br /&gt;
\]&lt;br /&gt;
where $m$ is the mass of the particle, $\hbar$ is reduced Planck constant and $\Psi(x,y;t)$ is the wave function. We set $\hbar / 2m = 1$ and $L=1$. &lt;br /&gt;
&lt;br /&gt;
The solution $\Psi(x,y;t)$ must therefore satisfy&lt;br /&gt;
\[&lt;br /&gt;
\nabla^2 \Psi = -i{\partial \over \partial t}\Psi \quad \text{in} \quad \Omega,&lt;br /&gt;
\]&lt;br /&gt;
with Dirichlet boundary condition&lt;br /&gt;
\[&lt;br /&gt;
\Psi = 0 \quad \text{on} \quad \partial \Omega,&lt;br /&gt;
\]&lt;br /&gt;
where $\Omega=[0, 1]\times[0, 1]$ denotes the square box domain and $\partial \Omega$ is the boundary of the domain. In order to get the unique solution for the time propagation of the wave function the initial state $\Psi(x, y,\, 0)$ has to be selected. We choose &lt;br /&gt;
\[&lt;br /&gt;
\Psi(x,y;t=0) = \sin{(\pi x)} \sin{(\pi y)}.&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
Once we prepare the domain and operators, we can turn the Schrodinger equation into code. As we are solving the time propagation implicitly, we will have to solve a matrix equation for every step. For this reason a space matrix $M$ is constructed. Next the equations are implemented, $psi$ denotes the matrix solution for each step and $rhs$ the right-hand side of the matrix equation which is in our case equivalent to the previous state $psi$ . &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
Eigen::SparseMatrix&amp;lt;std::complex&amp;lt;double&amp;gt;, Eigen::RowMajor&amp;gt; M(N, N);&lt;br /&gt;
// set initial state&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    double x = domain.pos(i, 0);&lt;br /&gt;
    double y = domain.pos(i, 1);&lt;br /&gt;
    rhs(i) = sin(PI * x) * sin(PI * y);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// set equation on interior&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    op.value(i) + (-1.0i) * dt * op.lap(i) = rhs(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// set equation on boundary&lt;br /&gt;
for (int i: domain.boundary()){&lt;br /&gt;
    op.value(i) = 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At each time step the matrix equation is solved using an Eigen linear equation solver, in this case, the BICGStab algorithm, and $rhs$ is updated. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// solve matrix system&lt;br /&gt;
psi = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// update rhs&lt;br /&gt;
rhs = psi;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The animation of the real part of solution $\Re \Psi(x,y; t)$ is presented below.&lt;br /&gt;
&lt;br /&gt;
[[File:video (1).mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2620</id>
		<title>Schrödinger equation</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2620"/>
				<updated>2019-06-17T09:37:50Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D infinite square well ==&lt;br /&gt;
We are solving a Schrödinger equation for a quantum particle that is confined to a 2-dimensional square box, $0&amp;lt;x&amp;lt;L$ and $0&amp;lt;y&amp;lt;L$.  Within this square the particle behaves as a free particle, but the walls are impenetrable, so the wave function  is zero at the walls. This is described by the infinite potential&lt;br /&gt;
&lt;br /&gt;
\[&lt;br /&gt;
V(x)=&lt;br /&gt;
\begin{cases}&lt;br /&gt;
0, &amp;amp;0&amp;lt;x&amp;lt;L,\: 0&amp;lt;y&amp;lt;L,&lt;br /&gt;
\\&lt;br /&gt;
\infty, &amp;amp;{\text{otherwise.}}&lt;br /&gt;
\end{cases}&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
With this potential Schrodinger equation simplifies to &lt;br /&gt;
\[&lt;br /&gt;
-{\hbar^2 \over 2m} \nabla^2 \Psi(x,y;t) = i\hbar {\partial \over \partial t}\Psi(x,y;t),&lt;br /&gt;
\]&lt;br /&gt;
where $m$ is the mass of the particle, $\hbar$ is reduced Planck constant and $\Psi(x,y;t)$ is the wave function. We set $\hbar / 2m = 1$ and $L=1$. &lt;br /&gt;
&lt;br /&gt;
The solution $\Psi(x,y;t)$ must therefore satisfy&lt;br /&gt;
\[&lt;br /&gt;
\nabla^2 \Psi = -i{\partial \over \partial t}\Psi \quad \text{in} \quad \Omega,&lt;br /&gt;
\]&lt;br /&gt;
with Dirichlet boundary condition&lt;br /&gt;
\[&lt;br /&gt;
\Psi = 0 \quad \text{on} \quad \partial \Omega,&lt;br /&gt;
\]&lt;br /&gt;
where $\Omega=[0, 1]\times[0, 1]$ denotes the square box domain and $\partial \Omega$ is the boundary of the domain. In order to get the unique solution for the time propagation of the wave function the initial state $\Psi(x, y,\, 0)$ has to be selected. We choose &lt;br /&gt;
\[&lt;br /&gt;
\Psi(x,y;t=0) = \sin{(\pi x)} \sin{(\pi y)}.&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
Once we prepare the domain and operators, we can turn the Schrodinger equation into code. As we are solving the time propagation implicitly, we will have to solve a matrix equation for every step. For this reason a space matrix $M$ is constructed. Next the equations are implemented, $psi$ denotes the matrix solution for each step and $rhs$ the right-hand side of the matrix equation which is in our case equivalent to the previous state $psi$ . &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
Eigen::SparseMatrix&amp;lt;std::complex&amp;lt;double&amp;gt;, Eigen::RowMajor&amp;gt; M(N, N);&lt;br /&gt;
// set initial state&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    double x = domain.pos(i, 0);&lt;br /&gt;
    double y = domain.pos(i, 1);&lt;br /&gt;
    rhs(i) = sin(PI * x) * sin(PI * y);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// set equation on interior&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    op.value(i) + (-1.0i) * dt * op.lap(i) = rhs(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// set equation on boundary&lt;br /&gt;
for (int i: domain.boundary()){&lt;br /&gt;
    op.value(i) = 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At each time step the matrix equation is solved using an Eigen linear equation solver, in this case, the BICGStab algorithm. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// solve matrix system&lt;br /&gt;
psi = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// update rhs&lt;br /&gt;
rhs = psi;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The animation of the real part of solution $\Re \Psi(x,y; t)$ is presented below.&lt;br /&gt;
&lt;br /&gt;
[[File:video (1).mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2619</id>
		<title>Schrödinger equation</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2619"/>
				<updated>2019-06-17T09:31:29Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D infinite square well ==&lt;br /&gt;
We are solving a Schrödinger equation for a quantum particle that is confined to a 2-dimensional square box, $0&amp;lt;x&amp;lt;L$ and $0&amp;lt;y&amp;lt;L$.  Within this square the particle behaves as a free particle, but the walls are impenetrable, so the wave function  is zero at the walls. This is described by the infinite potential&lt;br /&gt;
&lt;br /&gt;
\[&lt;br /&gt;
V(x)=&lt;br /&gt;
\begin{cases}&lt;br /&gt;
0, &amp;amp;0&amp;lt;x&amp;lt;L,\: 0&amp;lt;y&amp;lt;L,&lt;br /&gt;
\\&lt;br /&gt;
\infty, &amp;amp;{\text{otherwise.}}&lt;br /&gt;
\end{cases}&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
With this potential Schrodinger equation simplifies to &lt;br /&gt;
\[&lt;br /&gt;
-{\hbar^2 \over 2m} \nabla^2 \Psi(x,y;t) = i\hbar {\partial \over \partial t}\Psi(x,y;t),&lt;br /&gt;
\]&lt;br /&gt;
where $m$ is the mass of the particle, $\hbar$ is reduced Planck constant and $\Psi(x,y;t)$ is the wave function. We set $\hbar / 2m = 1$ and $L=1$. &lt;br /&gt;
&lt;br /&gt;
The solution $\Psi(x,y;t)$ must therefore satisfy&lt;br /&gt;
\[&lt;br /&gt;
\nabla^2 \Psi = -i{\partial \over \partial t}\Psi \quad \text{in} \quad \Omega,&lt;br /&gt;
\]&lt;br /&gt;
with Dirichlet boundary condition&lt;br /&gt;
\[&lt;br /&gt;
\Psi = 0 \quad \text{on} \quad \partial \Omega,&lt;br /&gt;
\]&lt;br /&gt;
where $\Omega=[0, 1]\times[0, 1]$ denotes the square box domain and $\partial \Omega$ is the boundary of the domain. In order to get the unique solution for the time propagation of the wave function the initial state $\Psi(x, y,\, 0)$ has to be selected. We choose &lt;br /&gt;
\[&lt;br /&gt;
\Psi(x,y;t=0) = \sin{(\pi x)} \sin{(\pi y)}.&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
Once we prepare the domain and operators, we can turn the Schrodinger equation into code. As we are solving the time propagation implicitly, we will have to solve a matrix equation for every step. For this reason a space matrix $M$ is constructed. Next the equations are implemented, $psi$ denotes the matrix solution for each step and $rhs$ the right-hand side of the matrix equation which is in our case equivalent to the previous state $psi$ . &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
Eigen::SparseMatrix&amp;lt;std::complex&amp;lt;double&amp;gt;, Eigen::RowMajor&amp;gt; M(N, N);&lt;br /&gt;
// set initial state&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    double x = domain.pos(i, 0);&lt;br /&gt;
    double y = domain.pos(i, 1);&lt;br /&gt;
    rhs(i) = sin(PI * x) * sin(PI * y);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// set equation on interior&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    op.value(i) + (-1.0i) * dt * op.lap(i) = rhs(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// set equation on boundary&lt;br /&gt;
for (int i: domain.boundary()){&lt;br /&gt;
    op.value(i) = 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At each time step the matrix equation is solved using an Eigen linear equation solver, in this case, the BICGStab algorithm. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// solve matrix system&lt;br /&gt;
psi = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// update rhs&lt;br /&gt;
rhs = psi;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The animation of the real part of solution $\Re \Psi(x,y; t)$ is presented below.&lt;br /&gt;
&lt;br /&gt;
[[File:video (1).mp4]]&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2618</id>
		<title>Schrödinger equation</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2618"/>
				<updated>2019-06-17T09:29:41Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D infinite square well ==&lt;br /&gt;
We are solving a Schrödinger equation for a quantum particle that is confined to a 2-dimensional square box, $0&amp;lt;x&amp;lt;L$ and $0&amp;lt;y&amp;lt;L$.  Within this square the particle behaves as a free particle, but the walls are impenetrable, so the wave function  is zero at the walls. This is described by the infinite potential&lt;br /&gt;
&lt;br /&gt;
\[&lt;br /&gt;
V(x)=&lt;br /&gt;
\begin{cases}&lt;br /&gt;
0, &amp;amp;0&amp;lt;x&amp;lt;L,\: 0&amp;lt;y&amp;lt;L,&lt;br /&gt;
\\&lt;br /&gt;
\infty, &amp;amp;{\text{otherwise.}}&lt;br /&gt;
\end{cases}&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
With this potential Schrodinger equation simplifies to &lt;br /&gt;
\[&lt;br /&gt;
-{\hbar^2 \over 2m} \nabla^2 \Psi(x,y;t) = i\hbar {\partial \over \partial t}\Psi(x,y;t),&lt;br /&gt;
\]&lt;br /&gt;
where $m$ is the mass of the particle, $\hbar$ is reduced Planck constant and $\Psi(x,y;t)$ is the wave function. We set $\hbar / 2m = 1$ and $L=1$. &lt;br /&gt;
&lt;br /&gt;
The solution $\Psi(x,y;t)$ must therefore satisfy&lt;br /&gt;
\[&lt;br /&gt;
\nabla^2 \Psi = -i{\partial \over \partial t}\Psi \quad \text{in} \quad \Omega,&lt;br /&gt;
\]&lt;br /&gt;
with Dirichlet boundary condition&lt;br /&gt;
\[&lt;br /&gt;
\Psi = 0 \quad \text{on} \quad \partial \Omega,&lt;br /&gt;
\]&lt;br /&gt;
where $\Omega=[0, 1]\times[0, 1]$ denotes the square box domain and $\partial \Omega$ is the boundary of the domain. In order to get the unique solution for the time propagation of the wave function the initial state $\Psi(x, y,\, 0)$ has to be selected. We choose &lt;br /&gt;
\[&lt;br /&gt;
\Psi(x,y;t=0) = \sin{(\pi x)} \sin{(\pi y)}.&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
Once we prepare the domain and operators, we can turn the Schrodinger equation into code. As we are solving the time propagation implicitly, we will have to solve a matrix equation for every step. For this reason a space matrix $M$ is constructed. Next the equations are implemented, $psi$ denotes the matrix solution for each step and $rhs$ the right-hand side of the matrix equation which is in our case equivalent to the previous state $psi$ . &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
Eigen::SparseMatrix&amp;lt;std::complex&amp;lt;double&amp;gt;, Eigen::RowMajor&amp;gt; M(N, N);&lt;br /&gt;
// set initial state&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    double x = domain.pos(i, 0);&lt;br /&gt;
    double y = domain.pos(i, 1);&lt;br /&gt;
    rhs(i) = sin(PI * x) * sin(PI * y);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// set equation on interior&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    op.value(i) + (-1.0i) * dt * op.lap(i) = rhs(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// set equation on boundary&lt;br /&gt;
for (int i: domain.boundary()){&lt;br /&gt;
    op.value(i) = 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At each time step the matrix equation is solved using an Eigen linear equation solver, in this case, the BICGStab algorithm. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// solve matrix system&lt;br /&gt;
psi = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// update rhs&lt;br /&gt;
rhs = psi;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The animation of the real part of solution $\Re \Psi(x,y; t)$ is presented below.&lt;br /&gt;
&lt;br /&gt;
[[File:infinite_well_2D_rsol_video.mp4]]&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=File:Video_(1).mp4&amp;diff=2617</id>
		<title>File:Video (1).mp4</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=File:Video_(1).mp4&amp;diff=2617"/>
				<updated>2019-06-17T09:27:47Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2616</id>
		<title>Schrödinger equation</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2616"/>
				<updated>2019-06-17T09:27:26Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D infinite square well ==&lt;br /&gt;
We are solving a Schrödinger equation for a quantum particle that is confined to a 2-dimensional square box, $0&amp;lt;x&amp;lt;L$ and $0&amp;lt;y&amp;lt;L$.  Within this square the particle behaves as a free particle, but the walls are impenetrable, so the wave function  is zero at the walls. This is described by the infinite potential&lt;br /&gt;
&lt;br /&gt;
\[&lt;br /&gt;
V(x)=&lt;br /&gt;
\begin{cases}&lt;br /&gt;
0, &amp;amp;0&amp;lt;x&amp;lt;L,\: 0&amp;lt;y&amp;lt;L,&lt;br /&gt;
\\&lt;br /&gt;
\infty, &amp;amp;{\text{otherwise.}}&lt;br /&gt;
\end{cases}&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
With this potential Schrodinger equation simplifies to &lt;br /&gt;
\[&lt;br /&gt;
-{\hbar^2 \over 2m} \nabla^2 \Psi(x,y;t) = i\hbar {\partial \over \partial t}\Psi(x,y;t),&lt;br /&gt;
\]&lt;br /&gt;
where $m$ is the mass of the particle, $\hbar$ is reduced Planck constant and $\Psi(x,y;t)$ is the wave function. We set $\hbar / 2m = 1$ and $L=1$. &lt;br /&gt;
&lt;br /&gt;
The solution $\Psi(x,y;t)$ must therefore satisfy&lt;br /&gt;
\[&lt;br /&gt;
\nabla^2 \Psi = -i{\partial \over \partial t}\Psi \quad \text{in} \quad \Omega,&lt;br /&gt;
\]&lt;br /&gt;
with Dirichlet boundary condition&lt;br /&gt;
\[&lt;br /&gt;
\Psi = 0 \quad \text{on} \quad \partial \Omega,&lt;br /&gt;
\]&lt;br /&gt;
where $\Omega=[0, 1]\times[0, 1]$ denotes the square box domain and $\partial \Omega$ is the boundary of the domain. In order to get the unique solution for the time propagation of the wave function the initial state $\Psi(x, y,\, 0)$ has to be selected. We choose &lt;br /&gt;
\[&lt;br /&gt;
\Psi(x,y;t=0) = \sin{(\pi x)} \sin{(\pi y)}.&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
Once we prepare the domain and operators, we can turn the Schrodinger equation into code. As we are solving the time propagation implicitly, we will have to solve a matrix equation for every step. For this reason a space matrix $M$ is constructed. Next the equations are implemented, $psi$ denotes the matrix solution for each step and $rhs$ the right-hand side of the matrix equation which is in our case equivalent to the previous state $psi$ . &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
Eigen::SparseMatrix&amp;lt;std::complex&amp;lt;double&amp;gt;, Eigen::RowMajor&amp;gt; M(N, N);&lt;br /&gt;
// set initial state&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    double x = domain.pos(i, 0);&lt;br /&gt;
    double y = domain.pos(i, 1);&lt;br /&gt;
    rhs(i) = sin(PI * x) * sin(PI * y);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// set equation on interior&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    op.value(i) + (-1.0i) * dt * op.lap(i) = rhs(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// set equation on boundary&lt;br /&gt;
for (int i: domain.boundary()){&lt;br /&gt;
    op.value(i) = 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At each time step the matrix equation is solved using an Eigen linear equation solver, in this case, the BICGStab algorithm. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// solve matrix system&lt;br /&gt;
psi = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// update rhs&lt;br /&gt;
rhs = psi;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The animation of the real part of solution $\Re \Psi(x,y; t)$ is presented below.&lt;br /&gt;
&lt;br /&gt;
[[File:video (1).mp4]]&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2615</id>
		<title>Schrödinger equation</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2615"/>
				<updated>2019-06-17T09:25:33Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D infinite square well ==&lt;br /&gt;
We are solving a Schrödinger equation for a quantum particle that is confined to a 2-dimensional square box, $0&amp;lt;x&amp;lt;L$ and $0&amp;lt;y&amp;lt;L$.  Within this square the particle behaves as a free particle, but the walls are impenetrable, so the wave function  is zero at the walls. This is described by the infinite potential&lt;br /&gt;
&lt;br /&gt;
\[&lt;br /&gt;
V(x)=&lt;br /&gt;
\begin{cases}&lt;br /&gt;
0, &amp;amp;0&amp;lt;x&amp;lt;L,\: 0&amp;lt;y&amp;lt;L,&lt;br /&gt;
\\&lt;br /&gt;
\infty, &amp;amp;{\text{otherwise.}}&lt;br /&gt;
\end{cases}&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
With this potential Schrodinger equation simplifies to &lt;br /&gt;
\[&lt;br /&gt;
-{\hbar^2 \over 2m} \nabla^2 \Psi(x,y;t) = i\hbar {\partial \over \partial t}\Psi(x,y;t),&lt;br /&gt;
\]&lt;br /&gt;
where $m$ is the mass of the particle, $\hbar$ is reduced Planck constant and $\Psi(x,y;t)$ is the wave function. We set $\hbar / 2m = 1$ and $L=1$. &lt;br /&gt;
&lt;br /&gt;
The solution $\Psi(x,y;t)$ must therefore satisfy&lt;br /&gt;
\[&lt;br /&gt;
\nabla^2 \Psi = -i{\partial \over \partial t}\Psi \quad \text{in} \quad \Omega,&lt;br /&gt;
\]&lt;br /&gt;
with Dirichlet boundary condition&lt;br /&gt;
\[&lt;br /&gt;
\Psi = 0 \quad \text{on} \quad \partial \Omega,&lt;br /&gt;
\]&lt;br /&gt;
where $\Omega=[0, 1]\times[0, 1]$ denotes the square box domain and $\partial \Omega$ is the boundary of the domain. In order to get the unique solution for the time propagation of the wave function the initial state $\Psi(x, y,\, 0)$ has to be selected. We choose &lt;br /&gt;
\[&lt;br /&gt;
\Psi(x,y;t=0) = \sin{(\pi x)} \sin{(\pi y)}.&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
Once we prepare the domain and operators, we can turn the Schrodinger equation into code. As we are solving the time propagation implicitly, we will have to solve a matrix equation for every step. For this reason a space matrix $M$ is constructed. Next the equations are implemented, $psi$ denotes the matrix solution for each step and $rhs$ the right-hand side of the matrix equation which is in our case equivalent to the previous state $psi$ . &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
Eigen::SparseMatrix&amp;lt;std::complex&amp;lt;double&amp;gt;, Eigen::RowMajor&amp;gt; M(N, N);&lt;br /&gt;
// set initial state&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    double x = domain.pos(i, 0);&lt;br /&gt;
    double y = domain.pos(i, 1);&lt;br /&gt;
    rhs(i) = sin(PI * x) * sin(PI * y);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// set equation on interior&lt;br /&gt;
for(int i : domain.interior()) {&lt;br /&gt;
    op.value(i) + (-1.0i) * dt * op.lap(i) = rhs(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// set equation on boundary&lt;br /&gt;
for (int i: domain.boundary()){&lt;br /&gt;
    op.value(i) = 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At each time step the matrix equation is solved using an Eigen linear equation solver, in this case, the BICGStab algorithm. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// solve matrix system&lt;br /&gt;
psi = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// update rhs&lt;br /&gt;
rhs = psi;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The animation of the real part of solution $\Re \Psi(x,y; t)$ is presented below.&lt;br /&gt;
&lt;br /&gt;
[[File:video.avi|400px]]&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2540</id>
		<title>Schrödinger equation</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2540"/>
				<updated>2019-05-21T09:20:29Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Solution procedure is still compiling ... so please wait for results :) &lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
The quantum world is governed by the [https://en.wikipedia.org/wiki/Schr%C3%B6dinger_equation Schrödinger equation]&lt;br /&gt;
&lt;br /&gt;
\[{\displaystyle {\hat {H}}|\psi (t)\rangle =i\hbar {\frac {\partial }{\partial t}}|\psi (t)\rangle } \]&lt;br /&gt;
&lt;br /&gt;
where $\hat H$ is the [https://en.wikipedia.org/wiki/Hamiltonian_(quantum_mechanics) Hamiltonian], $|\psi (t)\rangle$ is the [https://en.wikipedia.org/wiki/Wave_function quantum state function] and $\hbar$ is the reduced [https://en.wikipedia.org/wiki/Planck_constant Planck constant].&lt;br /&gt;
&lt;br /&gt;
The Hamiltonian consists of kinetic energy $\hat T$ and potential energy $\hat V$. As in classical mechanics, potential energy is a function of time and space, whereas the kinetic energy differs from the classical world and is calculated as&lt;br /&gt;
&lt;br /&gt;
\[\hat T = - \frac{\hbar^2}{2m} \nabla^2 .\]&lt;br /&gt;
&lt;br /&gt;
The final version of the single particle Schrödinger equation can be written as&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\[\left(- \frac{\hbar^2}{2m} \nabla^2 + V(t, \mathbf r)\right) \psi(t, \mathbf r) = i\hbar {\frac {\partial }{\partial t}}\psi(t, \mathbf r) \]&lt;br /&gt;
&lt;br /&gt;
Quantum state function is a complex function, so it is usually split into the real part and imaginary part&lt;br /&gt;
&lt;br /&gt;
\[ u, v \in C(\mathbb R)\colon \psi = u + i v , \]&lt;br /&gt;
&lt;br /&gt;
which for a real $V$ yields a system of two real equations&lt;br /&gt;
&lt;br /&gt;
\[\left(- \frac{\hbar^2}{2m} \nabla^2 + V(t, \mathbf r)\right) u(t, \mathbf r) = -\hbar {\frac {\partial }{\partial t}} v(t, \mathbf r) , \]&lt;br /&gt;
\[\left(- \frac{\hbar^2}{2m} \nabla^2 + V(t, \mathbf r)\right) v(t, \mathbf r) = \hbar {\frac {\partial }{\partial t}} u(t, \mathbf r) , \]&lt;br /&gt;
&lt;br /&gt;
which may be easier to handle.&lt;br /&gt;
&lt;br /&gt;
= Particle in a box =&lt;br /&gt;
&lt;br /&gt;
By selecting the potential $V(t, \mathbf r)$ and the initial state $\psi(0, \mathbf r)$ we get a unique solution for time propagation of the quantum state function. A theoretical one dimensional potential&lt;br /&gt;
&lt;br /&gt;
\[\displaystyle V(x)={\begin{cases}0,&amp;amp;0&amp;lt;x&amp;lt;L,\\\infty ,&amp;amp;{\text{otherwise,}}\end{cases}}\]&lt;br /&gt;
&lt;br /&gt;
is known as an infinite potential well. Its time independent eigenfunctions are&lt;br /&gt;
&lt;br /&gt;
\[\sqrt{\frac{2}{L}}\psi_n(x) = \sin\left(k_n x \right), \qquad n = 1,2,3,...\]&lt;br /&gt;
&lt;br /&gt;
where $k_n = \frac{\pi n}{L}$. With a time dependency &lt;br /&gt;
&lt;br /&gt;
\[\psi_n(t, x) = \mathrm e ^ {-i \omega_n t} \psi_n(x),\]&lt;br /&gt;
&lt;br /&gt;
where $\omega_n$ and $k_n$ are connected through dispersion relation through energy $E_n$&lt;br /&gt;
&lt;br /&gt;
\[{\displaystyle E_{n}=\hbar \omega _{n}={\frac {n^{2}\pi ^{2}\hbar ^{2}}{2mL^{2}}}={\frac {\hbar ^{2} k_n^2}{2m}}}.\]&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2539</id>
		<title>Schrödinger equation</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2539"/>
				<updated>2019-05-21T09:17:41Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Solution procedure is still compiling ... so please wait for results :) &lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
The quantum world is governed by the [https://en.wikipedia.org/wiki/Schr%C3%B6dinger_equation Schrödinger equation]&lt;br /&gt;
&lt;br /&gt;
\[{\displaystyle {\hat {H}}|\psi (t)\rangle =i\hbar {\frac {\partial }{\partial t}}|\psi (t)\rangle } \]&lt;br /&gt;
&lt;br /&gt;
where $\hat H$ is the [https://en.wikipedia.org/wiki/Hamiltonian_(quantum_mechanics) Hamiltonian], $|\psi (t)\rangle$ is the [https://en.wikipedia.org/wiki/Wave_function quantum state function] and $\hbar$ is the reduced [https://en.wikipedia.org/wiki/Planck_constant Planck constant].&lt;br /&gt;
&lt;br /&gt;
The Hamiltonian consists of kinetic energy $\hat T$ and potential energy $\hat V$. As in classical mechanics, potential energy is a function of time and space, whereas the kinetic energy differs from the classical world and is calculated as&lt;br /&gt;
&lt;br /&gt;
\[\hat T = - \frac{\hbar^2}{2m} \nabla^2 .\]&lt;br /&gt;
&lt;br /&gt;
The final version of the single particle Schrödinger equation can be written as&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\[\left(- \frac{\hbar^2}{2m} \nabla^2 + V(t, \mathbf r)\right) \psi(t, \mathbf r) = i\hbar {\frac {\partial }{\partial t}}\psi(t, \mathbf r) \]&lt;br /&gt;
&lt;br /&gt;
Quantum state function is a complex function, so it is usually split into the real part and imaginary part&lt;br /&gt;
&lt;br /&gt;
\[ u, v \in C(\mathbb R)\colon \psi = u + i v , \]&lt;br /&gt;
&lt;br /&gt;
which for a real $V$ yields a system of two real equations&lt;br /&gt;
&lt;br /&gt;
\[\left(- \frac{\hbar^2}{2m} \nabla^2 + V(t, \mathbf r)\right) u(t, \mathbf r) = -\hbar {\frac {\partial }{\partial t}} v(t, \mathbf r) , \]&lt;br /&gt;
\[\left(- \frac{\hbar^2}{2m} \nabla^2 + V(t, \mathbf r)\right) v(t, \mathbf r) = \hbar {\frac {\partial }{\partial t}} u(t, \mathbf r) , \]&lt;br /&gt;
&lt;br /&gt;
which may be easier to handle.&lt;br /&gt;
&lt;br /&gt;
= Particle in a box =&lt;br /&gt;
&lt;br /&gt;
By selecting the potential $V(t, \mathbf r)$ and the initial state $\psi(0, \mathbf r)$ we get a unique solution for time propagation of the quantum state function. A theoretical one dimensional potential&lt;br /&gt;
&lt;br /&gt;
\[\displaystyle V(x)={\begin{cases}0,&amp;amp;0&amp;lt;x&amp;lt;L,\\\infty ,&amp;amp;{\text{otherwise,}}\end{cases}}\]&lt;br /&gt;
&lt;br /&gt;
is known as an infinite potential well. Its time independent eigenfunctions are&lt;br /&gt;
&lt;br /&gt;
\[\sqrt{\frac{2}{L}}\psi_n(x) = \sin\left(k_n x \right), \qquad n = 1,2,3,...\]&lt;br /&gt;
&lt;br /&gt;
where $k_n = \frac{\pi n}{L}$. With a time dependency similar to Harmonic oscilator&lt;br /&gt;
&lt;br /&gt;
\[\psi_n(t, x) = \mathrm e ^ {-i \omega_n t} \psi_n(x),\]&lt;br /&gt;
&lt;br /&gt;
where $\omega_n$ and $k_n$ are connected through dispersion relation through energy $E_n$&lt;br /&gt;
&lt;br /&gt;
\[{\displaystyle E_{n}=\hbar \omega _{n}={\frac {n^{2}\pi ^{2}\hbar ^{2}}{2mL^{2}}}={\frac {\hbar ^{2} k_n^2}{2m}}}.\]&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2538</id>
		<title>Schrödinger equation</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=Schr%C3%B6dinger_equation&amp;diff=2538"/>
				<updated>2019-05-21T09:14:01Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: Created page with &amp;quot;Solution procedure is still compiling ... so please wait for results :)   = Introduction = The quantum world is governed by the [https://en.wikipedia.org/wiki/Schr%C3%B6dinger...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Solution procedure is still compiling ... so please wait for results :) &lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
The quantum world is governed by the [https://en.wikipedia.org/wiki/Schr%C3%B6dinger_equation Schrödinger equation]&lt;br /&gt;
&lt;br /&gt;
\[{\displaystyle {\hat {H}}|\psi (t)\rangle =i\hbar {\frac {\partial }{\partial t}}|\psi (t)\rangle } \]&lt;br /&gt;
&lt;br /&gt;
where $\hat H$ is the [https://en.wikipedia.org/wiki/Hamiltonian_(quantum_mechanics) Hamiltonian], $|\psi (t)\rangle$ is the [https://en.wikipedia.org/wiki/Wave_function quantum state function] and $\hbar$ is the reduced [https://en.wikipedia.org/wiki/Planck_constant Planck constant].&lt;br /&gt;
&lt;br /&gt;
The Hamiltonian consists of kinetic energy $\hat T$ and potential energy $\hat V$. As in classical mechanics, potential energy is a function of time and space, whereas the kinetic energy differs from the classical world and is calculated as&lt;br /&gt;
&lt;br /&gt;
\[\hat T = - \frac{\hbar^2}{2m} \nabla^2 .\]&lt;br /&gt;
&lt;br /&gt;
The final version of the single particle Schrödinger equation can be written as&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\[\left(- \frac{\hbar^2}{2m} \nabla^2 + V(t, \mathbf r)\right) \psi(t, \mathbf r) = i\hbar {\frac {\partial }{\partial t}}\psi(t, \mathbf r) \]&lt;br /&gt;
&lt;br /&gt;
Quantum state function is a complex function, so it is usually split into the real part and imaginary part&lt;br /&gt;
&lt;br /&gt;
\[ u, v \in C(\mathbb R)\colon \psi = u + i v , \]&lt;br /&gt;
&lt;br /&gt;
which for a real $V$ yields a system of two real equations&lt;br /&gt;
&lt;br /&gt;
\[\left(- \frac{\hbar^2}{2m} \nabla^2 + V(t, \mathbf r)\right) u(t, \mathbf r) = -\hbar {\frac {\partial }{\partial t}} v(t, \mathbf r) , \]&lt;br /&gt;
\[\left(- \frac{\hbar^2}{2m} \nabla^2 + V(t, \mathbf r)\right) v(t, \mathbf r) = \hbar {\frac {\partial }{\partial t}} u(t, \mathbf r) , \]&lt;br /&gt;
&lt;br /&gt;
which may be easier to handle.&lt;br /&gt;
&lt;br /&gt;
= Particle in a box =&lt;br /&gt;
&lt;br /&gt;
A theoretical one dimensional potential&lt;br /&gt;
&lt;br /&gt;
\[\displaystyle V(x)={\begin{cases}0,&amp;amp;0&amp;lt;x&amp;lt;L,\\\infty ,&amp;amp;{\text{otherwise,}}\end{cases}}\]&lt;br /&gt;
&lt;br /&gt;
is known as an infinite potential well. Its time independent eigenfunctions are&lt;br /&gt;
&lt;br /&gt;
\[\sqrt{\frac{2}{L}}\psi_n(x) = \sin\left(k_n x \right), \qquad n = 1,2,3,...\]&lt;br /&gt;
&lt;br /&gt;
where $k_n = \frac{\pi n}{L}$. With a time dependency similar to Harmonic oscilator&lt;br /&gt;
&lt;br /&gt;
\[\psi_n(t, x) = \mathrm e ^ {-i \omega_n t} \psi_n(x),\]&lt;br /&gt;
&lt;br /&gt;
where $\omega_n$ and $k_n$ are connected through dispersion relation through energy $E_n$&lt;br /&gt;
&lt;br /&gt;
\[{\displaystyle E_{n}=\hbar \omega _{n}={\frac {n^{2}\pi ^{2}\hbar ^{2}}{2mL^{2}}}={\frac {\hbar ^{2} k_n^2}{2m}}}.\]&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=Quantum_Mechanics&amp;diff=2537</id>
		<title>Quantum Mechanics</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=Quantum_Mechanics&amp;diff=2537"/>
				<updated>2019-05-21T09:12:59Z</updated>
		
		<summary type="html">&lt;p&gt;APirnat: Blanked the page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>APirnat</name></author>	</entry>

	</feed>