Complex Monte Carlo Integration

Click For Summary
SUMMARY

This discussion focuses on implementing complex Monte Carlo integration using the GNU Scientific Library (GSL) in C++. The user aims to extend GSL's capabilities to handle complex integrals, specifically for Feynman path integral formulations. The challenge lies in adapting GSL's function signature requirements, which necessitate using double arrays and pointers. The proposed solution involves creating a class that encapsulates the function and provides a method to convert the function's output into an array format suitable for GSL integration.

PREREQUISITES
  • Familiarity with C++ programming and object-oriented concepts
  • Understanding of the GNU Scientific Library (GSL) and its function integration capabilities
  • Knowledge of complex analysis, particularly in the context of path integrals
  • Experience with Monte Carlo methods and their application in numerical integration
NEXT STEPS
  • Explore advanced features of the GNU Scientific Library (GSL) for complex number handling
  • Research object-oriented design patterns in C++ for numerical methods
  • Learn about Feynman path integrals and their mathematical foundations
  • Investigate alternative libraries for complex numerical integration, such as Boost or Eigen
USEFUL FOR

Researchers and developers working in computational physics, numerical analysis, or anyone implementing complex integration techniques in C++ using the GNU Scientific Library.

Trajito
Messages
6
Reaction score
0
Hello,

I am trying to write a code taking path integrals in C++, using GNU Scientific Library. GSL is mainly written for C and does not include classes and other object-oriented language stuff, but it's also compatible with C++. Thus, what I first tried was making use of classes with GSL.

Since Feynman path integral formulation requires complex integration, I should first extend the standard GSL Monte Carlo function's abilities to taking complex integrals. I want to divide a function into two, real part and imaginary part. However, if I write a function which returns the real part of what is returned in the original function, my converting function must take the original function as its argument. But this brings trouble because GSL can integrate functions whose arguments must be (double [], size_t, void*). So, I have to return a function from a function.

Thank you
 
Physics news on Phys.org
You can make a class with the function as a member of it with an extra function such as

Convert(Double * DD, int size)

which when you call it, produces an array of data based on the function you have
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 21 ·
Replies
21
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 11 ·
Replies
11
Views
2K