-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Complex number #35
Comments
* Now, Vector can handle generic Scalar types
Hi @Axect. I am interested in this feature. At the moment I am using a fork of peroxide for my research which supports complex integration (by which I mean integration of complex functions of a real variable). My implementation, though working, is trivial (I wrote it without giving it much thought), so I don't believe it is upstreamable, but I am willing to work on a more suitable implementation that I can submit to you if you give me directions on what you would expect. To abandon my fork I would need full support of complex numbers, but since - as I said - complex integration is all I am using at the moment, this would be a great starting point for me. Best. |
Hi @GComitini. Thank you for your interest in the complex number support for Peroxide. I appreciate your willingness to contribute to the project. Currently, Peroxide doesn't have any support for complex numbers, but I do have plans to add this feature in the future. For matrices and vectors, I'm considering implementing separate However, for other operations like root finding, solving differential equations, and numerical integration, I don't have a clear idea yet on how to best implement complex number support. I'm open to suggestions and ideas from the community. One approach I'm considering is to create a separate As a first step, I plan to create the Regarding the namespace, although I intend to keep it separate from Implementing complex number support incrementally, starting with the most essential functions and gradually expanding, would be a pragmatic approach. This would also allow for better testing and refinement of the complex number implementations. I would be happy to collaborate with you and other interested contributors to design and implement complex number support in Peroxide. We can discuss ideas, share experiences, and work together to create a robust and user-friendly complex number module. Please feel free to share your thoughts, suggestions, or any specific ideas you have in mind. I'm excited to work with the community to bring complex number support to Peroxide. Best regards, |
Hi @Axect. I think creating a |
Hi @GComitini, Thanks for suggesting the use of generics to reduce duplication in the complex number integration functions. I appreciate your input. I've been considering how to make functions like If there's a way to implement generics without major changes to existing structs, I would be open to that. It could be a good solution. No definite decision has been made yet, and I'm always open to suggestions and discussions. Your ideas are highly valued and appreciated. Thank you again for your contribution. I value your thoughts and look forward to continuing our discussion. |
@Axect Hi, I am new to Rust and would also want to take a shot at this item. I see that you have already implemented Vectors for Complex in the dev branch. Can I work on the Matrix support for Complex? Also, would you please update which items in this list are done, and which are still remaining/newly added? |
@Axect I'm still interested too, all the more because integrating my changes into mainline peroxide would allow me to publish my library on crates.io without needlessly publishing a peroxide fork. Unfortunately, the last time I tried to write a (very long) reply to your last message my battery died and I lost everything I wrote, then I couldn't find the time to rewrite it from scratch. The TL;DR was: I don't think |
Hello, @soumyasen1809 Thank you for your interest. I've checked off the items related to Vector implementation in the issue list above, as they have all been completed. Working on Complex Matrix support is an excellent idea. However, since performance is crucial, I suggest approaching it in the following ways:
Let me know if you need any clarification or have any questions about these suggestions. I'm looking forward to your contributions! |
Thank you @GComitini for your detailed explanation and suggestion. I apologize for the delay in our discussion, and I appreciate your continued interest in this feature. Your approach to handling complex integration by splitting the integrand into real and imaginary parts (f(x) = u(x) + iv(x)) is indeed a good idea. Now that we've separated the complex feature into its own namespace, the issue of namespace duplication is resolved. As you suggested, it seems we can proceed without needing to support complex coefficients in the I noticed you've submitted a pull request related to this feature. That's great progress! I think the next step would be for me to review your PR in detail. This will give us a concrete foundation to discuss the specific design aspects of the complex integration implementation. As we go through the PR, we can address any particular implementation details or design choices that need further consideration. This approach will allow us to fine-tune the implementation and ensure it aligns well with the overall structure of Peroxide. Thank you again for your valuable input and for taking the initiative to submit a PR. Your expertise in this area is greatly appreciated, and I look forward to working together on the details of this feature. Let's continue our discussion in the context of your pull request. P.S. As it's been a while since our initial discussion, there might be some details I'm not remembering correctly. If you notice any inconsistencies or points that don't align with our previous conversations, please don't hesitate to point them out. I'm open to any corrections or clarifications you might have. |
Same for me! I apologize for the delay but I've been quite busy during the last months.
Looking forward to the discussion. I marked the PR as a draft precisely because that's what it is: a proposal for an implementation. Especially because I'm fully aware that it makes largish changes (albeit non-functional: as I wrote in the MR description, one of my aims was to leave real integration untouched) to the integration module, feel free to disagree with the design choices, I have no specific commitment to them, and if you think of ways to improve them I'll be happy to hear them.
Sure! |
@Axect Hi, I have an initial PR for this issue Note that:
Let's merge in small batches of PRs, since this issue is a big one. |
IMPL: generic and complex integration (#35)
Update on Issue #35: Support Complex NumbersDear team, I wanted to provide an update on our progress with Issue #35 (Support Complex number) in the Peroxide project. Current Status
Challenges and DecisionAs we progressed, we encountered two main challenges:
Given these challenges, we've made the following decision:
Moving ForwardTo maintain better organization and clarity in our development process, we propose the following approach for future work on this issue:
We believe this strategy will lead to a more streamlined development process and easier code reviews. It will also allow for more frequent integration of new features and modifications into our main development branch. Please let me know if you have any questions or concerns about this approach. Your feedback is always welcome as we continue to improve our project management and development workflows. Thank you for your ongoing contributions to the Peroxide project. |
Hello @GComitini and @soumyasen1809 Now, we publish |
Thanks @Axect! I was waiting for this to publish my own crate on crates.io :-) |
@GComitini Congratulations on publishing qcd-sme! It's wonderful to see your work going live on crates.io. |
Still peroxide supports only real number. But for many cases, complex number, vector & matrix should be required.
num_complex::Complex<F>
Vector
traitscrate::traits::math::{Vector, Normed, InnerProduct, LinearOp, VectorProduct}
crate::traits::fp::FPVector
Matrix
The text was updated successfully, but these errors were encountered: