I have a 4d matrix of complex doubles being generated by numpy. I need to transfer these numbers to some C++ code, where the data can be stored in whatever format is most convenient for this purpose. It seems to me that this is a highly complicated problem, which would involve writing the 4d matrix to a text file in some regular way, and having the C++ code read it back line by line in the same way, while parsing the complex numbers correctly. In the interest of not reinventing the wheel, I was wondering if there was any standard package or way to transfer these sorts of data structures from Python code to some C++ equivalent.
For a concrete example:
A = np.zeros((10, 20, 50, 1000), dtype='complex128')
# Then fill up all the entries of A with values