mindquantum.core.parameterresolver.PRGenerator
- class mindquantum.core.parameterresolver.PRGenerator(name='p', prefix: str = '', suffix: str = '', dtype=None)[source]
Generate parameters one by one.
- Parameters
Examples
>>> from mindquantum.core.parameterresolver import PRGenerator >>> pr_gen = PRGenerator() >>> print(pr_gen.new()) p0 >>> print(pr_gen.new(suffix='a')) p1_a >>> pr_gen.reset() >>> print(pr_gen.new()) p0 >>> pr_gen.size() 1