tidy3d.plugins.design.MethodMonteCarlo

Contents

tidy3d.plugins.design.MethodMonteCarlo#

class MethodMonteCarlo[source]#

Bases: AbstractMethodRandom

Select sampling points using Monte Carlo sampling. The sampling is done with the Latin Hypercube method from scipy.

Parameters:
  • name (Optional[str] = None) – Optional name for the sweep method.

  • filter_func (Optional[Callable[..., bool]] = None) – Optional callback called as filter_func(**sample) for each sampled parameter combination. Return True to keep the sample or False to skip it.

  • num_points (PositiveInt) – The number of points to be generated for sampling.

  • seed (Optional[PositiveInt] = None) – Sets the seed used by the optimizers to set constant random number generation.

  • filter_attempts_per_sample (PositiveInt = 32) – Maximum number of random sampling attempts per requested sample when filter_func is provided. The overall attempt limit is num_points * filter_attempts_per_sample.

Example

>>> import tidy3d.plugins.design as tdd
>>> method = tdd.MethodMonteCarlo(num_points=20)

Attributes

num_points

seed

filter_attempts_per_sample

filter_func

name