# Stochastic C-method

The stochastic option added to MC Grating's Chandezon codes in the 2026-05-25 release: a small random Brownian noise on the grating profile that can improve the convergence of the C method for deep gratings, at the price of results that are not exactly repeatable.

Canonical: https://mcgrating.com/features/stochastic-c-method.html


A convergence aid for deep smooth profiles, new in the 2026-05-25 release of the three Chandezon codes.

## What it does

The [C method](https://mcgrating.com/features/c-method.html) converges more slowly for deep gratings. The 2026-05-25 release adds an option, in the Settings dialog of the Chandezon codes, that follows a 2024 paper by J. Chandezon and G. Granet [[26](https://mcgrating.com/references.html#ref-26)], “Diffraction by gratings: from the C-method to the stochastic C-method”, J. Opt. Soc. Am. A 41, 1675 ([doi:10.1364/JOSAA.530262](https://doi.org/10.1364/JOSAA.530262)): a small random Brownian noise is added to the grating profile, which can sometimes improve convergence.

## The trade-off, in the changelog's own words

> Added option for Stochastic C-method according to JOSA A v.41 (9), p.1675 (2024). Thanks to Dr. J. Chandezon. Adding a small random Brownian noise to the grating profile can sometimes improve the convergence of the C-method for large grating depths, however the results with it applied are not exactly repeatable.

For a result that must be reproducible to the last digit, leave it off.

## Where it lives

In the same release the C-method code was refactored and the Settings dialog modified; the option is available in [Chandezon Collinear](https://mcgrating.com/products.html#chandezon-collinear), [Chandezon Conical](https://mcgrating.com/products.html#chandezon-conical) and [Chandezon Crossed](https://mcgrating.com/products.html#chandezon-crossed). The in-application help (last revised in 2018) does not describe it yet; the [changelog entry](https://mcgrating.com/changelog.html#v2026-05-25) is the reference, and the [Settings dialog topic](https://mcgrating.com/docs/chandezon/settings.html) covers the rest of the dialog.
