Sovling schrodinger's equation in C++

In summary, Schrodinger's equation is a fundamental equation in quantum mechanics that describes the behavior and evolution of a quantum system over time. It is important to solve it in C++ because it allows for complex calculations and simulations, making it an ideal tool for studying quantum systems. Schrodinger's equation can be solved in C++ using numerical methods such as the finite difference method or the variational method. However, one of the main challenges is the large computational resources required for accurate simulations. The accuracy of the solution in C++ can be verified by comparing it to analytical solutions or experimental data, as well as by testing the code with different parameters.
  • #1
Rasine
208
0
i need help coming up with a way to solve for the eigen vectors of schrodinger's time independant equation in c++.

so i want to write a class that uses the shooting method, but i am not sure how to do that.
 
Technology news on Phys.org
  • #3


I can understand the importance of solving Schrodinger's equation in various fields of physics and engineering. Using C++ to solve this equation can be a challenging task, but it is definitely possible.

To solve for the eigen vectors of Schrodinger's time independent equation, you can use the shooting method. This method involves solving an initial value problem by breaking it down into smaller boundary value problems. In C++, you can write a class that implements the shooting method by defining functions for the initial value problem, boundary value problem, and the shooting algorithm itself.

Firstly, you can define a function for the initial value problem, which takes in the initial conditions of the wave function and its derivative. This function can be solved using a numerical integration method like the Runge-Kutta method.

Next, you can define a function for the boundary value problem, which takes in the boundary conditions of the wave function. This function can be solved using the initial value problem function and a root-finding algorithm like the bisection method.

Finally, you can implement the shooting algorithm by using the initial value problem and boundary value problem functions to iteratively adjust the initial conditions until the boundary conditions are satisfied. This will give you the eigen vectors of Schrodinger's equation.

Additionally, you can also consider using existing libraries or packages in C++ that are specifically designed for solving differential equations like Eigen or Armadillo. These libraries provide efficient and accurate methods for solving Schrodinger's equation.

In conclusion, solving Schrodinger's equation in C++ using the shooting method can be achieved by defining appropriate functions and implementing the shooting algorithm. With careful implementation and use of libraries, you can obtain accurate results for the eigen vectors of Schrodinger's equation.
 

1. What is Schrodinger's equation?

Schrodinger's equation is a fundamental equation in quantum mechanics that describes the behavior and evolution of a quantum system over time.

2. Why is it important to solve Schrodinger's equation in C++?

C++ is a powerful programming language that allows for complex calculations and simulations, making it an ideal tool for solving Schrodinger's equation and studying quantum systems.

3. How is Schrodinger's equation solved in C++?

Schrodinger's equation can be solved in C++ using numerical methods, such as the finite difference method or the variational method, which involve discretizing the equation and solving it on a computer.

4. What are some challenges in solving Schrodinger's equation in C++?

One of the main challenges in solving Schrodinger's equation in C++ is the large computational resources required for accurate simulations, as quantum systems can involve a large number of variables and complex interactions.

5. How is the accuracy of the solution in C++ verified?

The accuracy of the solution in C++ can be verified by comparing it to analytical solutions or experimental data, as well as by testing the code with different parameters and checking for consistency and convergence.

Similar threads

  • Programming and Computer Science
Replies
2
Views
2K
  • Advanced Physics Homework Help
Replies
1
Views
712
  • Art, Music, History, and Linguistics
5
Replies
151
Views
5K
  • Programming and Computer Science
Replies
6
Views
2K
Replies
24
Views
2K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
1
Views
1K
  • Quantum Physics
Replies
1
Views
1K
  • Quantum Physics
Replies
3
Views
1K
  • Quantum Physics
5
Replies
143
Views
6K
Back
Top