Complex Monte Carlo Integration

Click For Summary
The discussion focuses on implementing path integrals in C++ using the GNU Scientific Library (GSL), which is primarily designed for C. The user aims to extend GSL's Monte Carlo integration capabilities to handle complex integrals, specifically by separating a function into its real and imaginary parts. A challenge arises because GSL requires functions to conform to a specific argument structure, complicating the integration of functions that need to return other functions. The proposed solution involves creating a class that includes the function as a member and an additional method to convert the function's output into a compatible format for GSL. This approach aims to facilitate the integration of complex functions while adhering to GSL's requirements.
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
 
Thread 'Unexpected irregular reflection signal from a high-finesse cavity'
I am observing an irregular, aperiodic noise pattern in the reflection signal of a high-finesse optical cavity (finesse ≈ 20,000). The cavity is normally operated using a standard Pound–Drever–Hall (PDH) locking configuration, where an EOM provides phase modulation. The signals shown in the attached figures were recorded with the modulation turned off. Under these conditions, when scanning the laser frequency across a cavity resonance, I expected to observe a simple reflection dip. Instead...

Similar threads

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