{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/neural-functional-learning-function-to-scalar","title":"Neural Functional: Learning Function to Scalar Maps for Neural PDE Surrogates","arxiv_id":"2505.13275","date":"2025-05-19","proceeding":null,"authors":["Anthony Zhou","Amir Barati Farimani"],"abstract":"Many architectures for neural PDE surrogates have been proposed in recent years, largely based on neural networks or operator learning. In this work, we derive and propose a new architecture, the Neural Functional, which learns function to scalar mappings. Its implementation leverages insights from operator learning and neural fields, and we show the ability of neural functionals to implicitly learn functional derivatives. For the first time, this allows for an extension of Hamiltonian mechanics to neural PDE surrogates by learning the Hamiltonian functional and optimizing its functional derivatives. We demonstrate that the Hamiltonian Neural Functional can be an effective surrogate model through improved stability and conserving energy-like quantities on 1D and 2D PDEs. Beyond PDEs, functionals are prevalent in physics; functional approximation and learning with its gradients may find other uses, such as in molecular dynamics or design optimization.","url_abs":"https://arxiv.org/abs/2505.13275v1","url_pdf":"https://arxiv.org/pdf/2505.13275v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"neural-functional-learning-function-to-scalar","repo_url":"https://github.com/anthonyzhou-1/hamiltonian_pdes","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"operator-learning","task_name":"Operator learning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2505.13275","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2505.13275"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"deterministic:regex_extraction","url":"https://github.com/anthonyzhou-1/hamiltonian_pdes","reach":null}],"summary":{"ran":2,"ran_draft_wrong":1,"ran_fixture":1,"unverified":1},"by_repo_kind":{"official":{"samples":5,"ran":4,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":5,"samples":[{"code_sha256_prefix":"817a8542e914d869","entry":"SGolayFilter2","repo":"anthonyzhou-1/hamiltonian_pdes","repo_kind":"official","path":"modules/models/Hamiltonian.py","file_url":"https://github.com/anthonyzhou-1/hamiltonian_pdes/blob/HEAD/modules/models/Hamiltonian.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"817a8542e914d869"}},{"code_sha256_prefix":"df104062434f2f41","entry":"SGolayKernel2","repo":"anthonyzhou-1/hamiltonian_pdes","repo_kind":"official","path":"modules/models/Hamiltonian.py","file_url":"https://github.com/anthonyzhou-1/hamiltonian_pdes/blob/HEAD/modules/models/Hamiltonian.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"df104062434f2f41"}},{"code_sha256_prefix":"d19eb3c4ca917eb6","entry":"first_derivative","repo":"anthonyzhou-1/hamiltonian_pdes","repo_kind":"official","path":"modules/models/Hamiltonian.py","file_url":"https://github.com/anthonyzhou-1/hamiltonian_pdes/blob/HEAD/modules/models/Hamiltonian.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d19eb3c4ca917eb6"}},{"code_sha256_prefix":"929c07f9bc98351f","entry":"first_derivative_2d","repo":"anthonyzhou-1/hamiltonian_pdes","repo_kind":"official","path":"modules/models/Hamiltonian.py","file_url":"https://github.com/anthonyzhou-1/hamiltonian_pdes/blob/HEAD/modules/models/Hamiltonian.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"929c07f9bc98351f"}},{"code_sha256_prefix":"b026cd6d9cf6e416","entry":"Hamiltonian_Wrapper","repo":"anthonyzhou-1/hamiltonian_pdes","repo_kind":"official","path":"modules/models/Hamiltonian.py","file_url":"https://github.com/anthonyzhou-1/hamiltonian_pdes/blob/HEAD/modules/models/Hamiltonian.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b026cd6d9cf6e416"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}