{"id":"c425ba4f-8ed6-43ce-9361-b54dd8feb7ab","arxiv_id":"2411.18591","paper_version":1,"verdict":"CONDITIONAL","confidence":"MODERATE","novelty_score":5.0,"correctness_risk":"medium","formal_verification":"none","parameter_count":0,"one_line_summary":"An open-source PyTorch library that makes Fourier optics simulations differentiable and GPU-accelerated, with support for polarization and arbitrary spatial coherence.","lead":"TorchOptics is a new open-source Python library that simulates optical systems with differentiable Fourier optics, using PyTorch for GPU acceleration and automatic differentiation. It lets researchers optimize imaging and holography setups by training them like neural networks, and supports polarized and partially coherent light.","discovery_kind":"extension","skeptic_critique":{"model":"deepseek-v4-flash","headline":"Gradient correctness for the core FFT-based propagation and modulation ops is unvalidated; a finite-difference check would settle whether the inverse-design claim holds.","rationale":"The reader's weakest_assumption correctly identifies the absence of gradient validation and coherence validation. I focus on gradient correctness as the single most load-bearing concern because the library's central claim is 'differentiable Fourier optics simulations' and 'end-to-end optimization of hybrid models' (Abstract, Sec. 4). Forward propagation is partially validated by Fig. 3, but no similar validation exists for gradients. PyTorch's autodiff is generally reliable, but the paper introduces custom operations (FFT-based convolution, complex-valued field transformations, interpolation) that can harbor subtle gradient bugs, such as missing conjugates or incorrect FFT normalization. The provided optimization example (Fig. 4) shows a decreasing loss, but this alone does not establish gradient correctness. A finite-difference check is cheap, standard, and would settle the matter. I agree with the reader that the coherence propagation also lacks reference validation, but it is a more advanced feature and less central to the library's main purpose. Thus the reader's conditional verdict remains appropriate, and no adjustment is needed.","tokens_in":11800,"tokens_out":6522,"duration_ms":78706,"concrete_test":"Run a central finite-difference gradient check on a small random instance: take a 64x64 random complex field, propagate it with both the DI and AS methods over a distance, apply a phase modulator with trainable parameters, and compute a scalar loss such as the squared modulus at one output pixel. Compare torch.autograd.grad to central finite differences with epsilon = 1e-6 * (1 + |parameter|), repeating for each parameter. If the maximum relative error exceeds 1e-4 for any operation, the autodiff claim is not supported. Optionally, also propagate a Gaussian Schell CoherenceField and compare the output cross-spectral density to the analytic formula or to a Monte Carlo average over independent random phase screens.","verdict_should_be":"UNCHANGED","load_bearing_attack":"The paper's central value proposition is differentiable Fourier optics for inverse design and end-to-end hybrid optimization (Sec. 4). The forward operations include FFT-based convolution (Eqs. 2-5), pointwise complex modulation (Eq. 1), interpolation between grids, and parametrized constraints, all of which flow through PyTorch autodiff. Yet no numerical gradient check against finite differences or analytic derivatives is provided. The training curve in Fig. 4c is weak evidence, since an incorrect gradient can still decrease loss in favorable cases. If any operation has a subtle autodiff error—for example in handling complex conjugates or FFT scaling—the flagship optimization claim fails, while the forward propagation accuracy shown in Fig. 3 would remain unaffected. The mutual coherence propagation (Eq. 13) is also unvalidated, but the differentiability of the standard coherent pipeline is the more load-bearing assumption because it underpins the library's primary stated purpose.","agreement_with_reader":"partial"},"referee_report":{"model":"deepseek-v4-flash","summary":"The paper introduces TorchOptics, an open-source Python library for differentiable Fourier optics simulations built on PyTorch. It describes three core classes (Field, Element, System), the underlying scalar diffraction theory (Rayleigh-Sommerfeld direct integration and angular spectrum propagation, Eqs. 2-5), and the use of PyTorch automatic differentiation for gradient-based optimization of optical elements and hybrid optical-neural models. Additional features include polarized fields through Jones calculus (Sec. 5.1), fields with arbitrary spatial coherence represented by the mutual coherence function (Sec. 5.2), polychromatic fields (Sec. 5.3), and standard spatial profiles (Sec. 5.4). The paper validates forward propagation accuracy against a SciPy quadrature reference (Fig. 3), shows computation-time scaling (Fig. 2), demonstrates a phase-modulator training example (Listing 2, Fig. 4), and gives a polarizer power-consistency example (Listing 3). It presents the coherence propagation of Eq. (13) only through qualitative intensity plots (Fig. 5).","tokens_in":11930,"tokens_out":2662,"duration_ms":26900,"significance":"If the results are trustworthy, TorchOptics would be a useful community resource: it is open-source under MIT, installable from PyPI, GPU-accelerated, and follows PyTorch conventions, which lowers the barrier for applying automatic differentiation to Fourier-optics inverse design and end-to-end hybrid optimization. The mathematical formulation (Eqs. 1-14) is standard and, as far as it goes, correctly presented. The paper gives reproducible code listings, a quantitative forward-propagation accuracy check against an independent quadrature solver, and a concrete demonstration of parameter optimization. These are real strengths. However, the two flagship claims for which the library would be adopted—reliable gradients for inverse design and simulation of arbitrary spatial coherence—are exactly the parts that lack quantitative validation. The central value proposition is therefore plausible but not yet established.","major_comments":[{"comment":"No numerical verification of the gradients is provided. The paper's central claim is that TorchOptics enables gradient-based optimization and end-to-end differentiable modeling, and this claim rests entirely on PyTorch autodiff through FFT-based convolution, pointwise complex multiplication, grid interpolation, and parametrized constraints. The loss curve in Fig. 4(c) is weak evidence: an incorrect gradient can still decrease the loss in a favorable case, and it says nothing about the correctness of gradients for the coherence or polarization paths. I recommend adding a finite-difference (or analytic) gradient check for representative operations, including the complex FFT scaling in Eqs. (2)-(5), modulation of Eq. (1), and a simple propagation through a lens. This is a load-bearing validation for the primary purpose of the library.","section":"Sec. 5.2"},{"comment":"The mutual coherence propagation is not quantitatively validated. Eq. (13) is a standard result, but the manuscript only demonstrates it through the qualitative diffraction patterns of Fig. 5. Since the abstract explicitly claims support for 'fields with arbitrary spatial coherence,' the implementation should be checked against a reference solution—for example, the analytic propagation of a Gaussian-Schell-model beam, or a numerical evaluation by independent quadrature—including a comparison of both intensity and coherence (e.g., visibility or the cross-spectral density at selected point pairs). The paper should also specify how the four-dimensional tensor in CoherenceField is discretized and how boundary conditions and zero-padding are handled in the double convolution of Eq. (13). Without this, the coherence feature is an unverified flagship capability.","section":"Sec. 3"},{"comment":"The forward-propagation validation covers only the DI method, not the AS method. The text claims both methods are implemented and that the library automatically selects between them based on Eq. (6), but Fig. 3 reports errors only for the DI method and only for z-values satisfying the sampling condition. Since the AS method is the default for short propagation distances, an analogous error analysis for AS (or at least a statement that AS has been checked against the same quadrature reference) would make the accuracy claim for the library's core operation complete.","section":"Sec. 3 / Fig. 3"}],"minor_comments":[{"comment":"There are several typographical issues, including 'di fferent' in the abstract and introduction, 'theAngular' in Sec. 3, and 'evaulation' in the caption of Fig. 2. These should be corrected in a final revision.","section":"Abstract and throughout"},{"comment":"The caption calls this a 'one-dimensional aperture simulation,' but panel (a) shows a two-dimensional yz-plane intensity map. Please clarify whether the aperture is one-dimensional in y with uniformity along x, or a two-dimensional slit of finite x extent, since this affects how the reader interprets the error metric.","section":"Fig. 3 caption"},{"comment":"In the polychromatic example, `torch.zeros_like(input_data)` may not match the dtype or shape of `output_field.intensity()`. Initializing with `torch.zeros_like(output_field.intensity())` after the first iteration, or explicitly specifying dtype and device, would be safer and clearer.","section":"Listing 5"},{"comment":"The list of profiles is useful, but the paper does not mention whether the generated profiles are differentiable with respect to their parameters (e.g., waist radius, grating period). A brief statement about this would help users know whether these profiles can be used directly in inverse design.","section":"Sec. 5.4"}],"recommendation":"major_revision","confidential_remarks":"The paper is a software-description manuscript for Computer Physics Communications, and its format is appropriate for that venue. The main concern is not novelty but verification: gradient correctness and coherence propagation are the two features that distinguish TorchOptics from a standard textbook Fourier-optics implementation, and neither is quantitatively checked. If the authors add a finite-difference gradient test and a coherence propagation validation against a reference solution, I would support publication. There is no indication of circular reasoning or unsupported citation practices; the authors' prior work [31] is used appropriately for motivation and scaling discussion."},"author_rebuttal":null,"desk_editor":{"model":"deepseek-v4-flash","letter":"Quick take: this is a competent, useful software paper. The library is a clean PyTorch-native implementation of standard Fourier optics, and the forward simulations look validated; the two missing pieces—an explicit gradient check and a quantitative coherence-propagation validation—are the only things keeping it from being a complete package.\n\nWhat's actually new: TorchOptics bundles differentiable DI, AS, and Fresnel propagation with a PyTorch Module-based API, and adds two less common features in this format: polarization through Jones calculus and arbitrary spatial coherence through the mutual coherence function. The code is open source, MIT-licensed, installable from PyPI, and the examples in Listings 1–5 are readable and reproducible. The forward-propagation error against a quadrature reference (Fig. 3) is a real validation, and the polarization power bookkeeping in Listing 3 is a sensible sanity check. The paper's equations are standard and correctly written.\n\nSoft spots, in order of importance. First, the paper's central value proposition is gradient-based inverse design, but there is no numerical gradient check against finite differences or analytic derivatives. The training curve in Fig. 4c shows loss decreasing, but that is weak evidence; a wrong gradient can still decrease loss in favorable settings. This is easy to fix—adding a two-line finite-difference comparison for the DI, AS, and modulation ops would settle it. Second, the mutual coherence propagation (Eq. 13) is only shown qualitatively in Fig. 5, with no reference solution or experiment. The equation is standard, but the 4D tensor implementation could have bugs, and a quantitative check would be valuable. Neither issue is evidence of an actual error; they are missing validations. As a software-paper reviewer, I'd want them before endorsing the flagship claims.\n\nBottom line: this is a paper for people who do computational optics or optical ML and want a differentiable library to build on. It deserves serious peer review, and the open-source availability means the authors' claims can be independently checked. My recommendation: send it to review, ask for the gradient check and a coherence-validation figure. If those come back clean, the paper fully supports its claims.","headline":"A solid, useful PyTorch library paper for differentiable Fourier optics; the forward simulations are well validated, but the paper omits two easy checks—gradient correctness and quantitative coherence propagation—that would fully back its flagship claims.","tokens_in":12456,"tokens_out":1761,"would_cite":true,"duration_ms":16573,"reading_group":"maybe","serious_thinker":"yes","would_accept_peer_review":true},"rs_alignment":null,"lean_confirmation":null,"pith_extraction":{"msc":[],"pacs":[],"model":"deepseek-v4-flash","headline":"TorchOptics claims to make Fourier optics simulation differentiable end-to-end, enabling gradient-based inverse design of optical systems and joint optimization with neural networks.","keywords":["Fourier optics","automatic differentiation","inverse design","optical simulation","PyTorch","spatial coherence","polarization","computational imaging"],"falsifier":"Compare TorchOptics gradients against finite differences for a two-lens system with trainable phase profiles, and compare its simulated partially coherent diffraction pattern against the analytic Gaussian Schell-model propagation or an independent numerical integration; disagreement beyond numerical tolerance would falsify the central claims.","tokens_in":11583,"feed_emoji":"🔬","tokens_out":5013,"duration_ms":42607,"temperature":0.7,"pith_summary":"TorchOptics is a Python library that treats Fourier optics simulations as differentiable tensor computations, so that light propagation through lenses, modulators, and other elements can be optimized by gradient descent. The paper's central claim is that this makes optical hardware design, including inverse design and end-to-end training of hybrid optics-plus-neural-network models, practical within a single framework. It further claims support for polarized light via Jones calculus and for arbitrary spatial coherence via the mutual coherence function, going beyond the usual scalar coherent simulations. A sympathetic reader would care because this lowers the barrier to jointly optimizing physical optics and machine learning post-processing.","feed_headline":"Optics library makes optical hardware trainable like neural nets","feed_subtitle":"TorchOptics wraps Fourier optics in PyTorch autodiff for gradient-based inverse design and joint optics-ML training.","key_machinery":"The load-bearing objects are the Field, Element, and System classes, all inheriting from PyTorch's Module, together with two FFT-based propagation algorithms: the Direct Integration method for the Rayleigh-Sommerfeld integral and the Angular Spectrum method, selected automatically by a critical-distance criterion. Modulation is a pointwise product with a (possibly trainable) complex profile; propagation is an FFT convolution or spectral filter; both are differentiable. For coherence, the library stores the mutual coherence function as a four-dimensional tensor and propagates it by the four-fold diffraction integral, at quadratic memory cost relative to coherent fields.","core_discovery":"The central discovery is that the operations of computational Fourier optics—pointwise modulation, Rayleigh-Sommerfeld propagation by direct integration, angular spectrum propagation, and their compositions—can be implemented as PyTorch module operations whose parameters are ordinary trainable tensors. On top of this, the Field, Element, and System classes give the user a small object model: fields carry sampled wavefronts, elements apply differentiable transformations, and systems sequence them along the optical axis. The same automatic differentiation that trains neural networks therefore computes gradients of a simulation loss with respect to element positions, phase profiles, and other continuous properties. The paper demonstrates this by training three phase modulators to split a Gaussian beam, and it extends the framework to polarized fields (Jones vectors and matrices) and partially coherent fields (mutual coherence tensors).","pith_inferences":["The paper does not include a finite-difference or analytic verification of the gradients; a direct check of backpropagated versus numerical gradients for a small lens system would settle whether the advertised differentiability is exact.","The mutual coherence propagation is shown only qualitatively; comparing a simulated Gaussian Schell-model field against the known analytic propagation would test the coherence machinery.","Because coherence simulation scales quadratically in memory, its practical reach is limited; the library could be extended with approximations such as mode decomposition for large partially coherent fields.","The same field-element-system design could be reused for time-domain or non-paraxial propagators, though the paper does not claim those capabilities."],"forward_implications":["Optical system parameters such as phase profiles, element positions, and modulation responses can be optimized with standard gradient-based optimizers such as Adam.","Hybrid models that cascade physical optics into neural networks can be trained end to end in a single backward pass.","Inverse design is available for systems using polarized light and spatially partially coherent illumination, not just coherent scalar fields.","GPU acceleration and batching over multiple fields make large-scale optimization of optical systems practical.","A built-in critical-distance rule of thumb tells users which propagation algorithm to choose for better sampling accuracy."],"supporting_citations":[{"why":"Supplies the scalar diffraction theory, including the Rayleigh-Sommerfeld integral and transfer-function formalism, on which the propagation methods are built.","marker":"[15]"},{"why":"Provides the PyTorch automatic differentiation engine and tensor framework that the library uses for gradients and GPU computation.","marker":"[23]"},{"why":"Introduces the FFT-based Direct Integration method for the Rayleigh-Sommerfeld formula that TorchOptics implements.","marker":"[27]"},{"why":"Defines the Angular Spectrum method and the critical propagation distance used to choose between propagation algorithms.","marker":"[28]"},{"why":"Supplies matrix Fourier optics and Jones calculus, the basis for polarized-field simulation.","marker":"[25]"},{"why":"Supplies the statistical-optics background and mutual coherence formalism for partially coherent fields.","marker":"[26]"},{"why":"Provides the reference quadrature integration used to quantify propagation error in the paper's accuracy analysis.","marker":"[29]"},{"why":"The Adam optimizer used in the trained beam-splitting demonstration, showing integration with standard PyTorch optimization.","marker":"[24]"}],"fun_headline_variants":["TorchOptics: Differentiable Fourier optics in PyTorch","Train optical hardware with gradient-based autodiff","Open-source optics simulator with automatic differentiation","Backprop through your optical system with TorchOptics","Differentiable optics for joint optics-ML optimization"],"cache_read_input_tokens":3200,"weakest_assumption_plain":"The framework's usefulness rests on the assumption that automatic differentiation through every propagation and modulation operation yields correct gradients and that the mutual coherence propagation is physically accurate; the paper provides demonstrations but not a reference validation of either.","fun_headline_variants_meta":{"raw":{"variants":["TorchOptics: Differentiable Fourier optics in PyTorch","Train optical hardware with gradient-based autodiff","Open-source optics simulator with automatic differentiation","Backprop through your optical system with TorchOptics","Differentiable optics for joint optics-ML optimization"]},"model":"deepseek-v4-flash","effort":"low","cost_usd":0.000259,"raw_usage":{"total_tokens":1522,"prompt_tokens":821,"completion_tokens":701,"prompt_tokens_details":{"cached_tokens":384},"prompt_cache_hit_tokens":384,"prompt_cache_miss_tokens":437,"completion_tokens_details":{"reasoning_tokens":626}},"tokens_in":437,"tokens_out":701,"duration_ms":6824,"temperature":1.0,"reasoning_tokens":626,"cache_read_input_tokens":384,"cache_creation_input_tokens":0},"cache_creation_input_tokens":0},"created_at":"2026-08-12T11:01:49.863277+00:00","model_set":{"reader":"deepseek-v4-flash"},"falsifier":"Compare TorchOptics gradients against finite differences for a two-lens system with trainable phase profiles, and compare its simulated partially coherent diffraction pattern against the analytic Gaussian Schell-model propagation or an independent numerical integration; disagreement beyond numerical tolerance would falsify the central claims.","supporting_citations":[{"cited_title":"Goodman, Introduction to Fourier Optics, fourth edition Edition, W","cited_arxiv_id":null,"evidence_quote":"Supplies the scalar diffraction theory, including the Rayleigh-Sommerfeld integral and transfer-function formalism, on which the propagation methods are built."},{"cited_title":null,"cited_arxiv_id":null,"evidence_quote":"Provides the PyTorch automatic differentiation engine and tensor framework that the library uses for gradients and GPU computation."},{"cited_title":null,"cited_arxiv_id":null,"evidence_quote":"Introduces the FFT-based Direct Integration method for the Rayleigh-Sommerfeld formula that TorchOptics implements."},{"cited_title":null,"cited_arxiv_id":null,"evidence_quote":"Defines the Angular Spectrum method and the critical propagation distance used to choose between propagation algorithms."},{"cited_title":"V oelz, Computational Fourier Optics: A MATLAB Tutorial, no","cited_arxiv_id":null,"evidence_quote":"Provides the reference quadrature integration used to quantify propagation error in the paper's accuracy analysis."},{"cited_title":"Paszke, S","cited_arxiv_id":null,"evidence_quote":"The Adam optimizer used in the trained beam-splitting demonstration, showing integration with standard PyTorch optimization."}],"review_version":1}