Skip to content

Certain angle and epsilon combinations result in errors #2

@HaoTy

Description

@HaoTy

Certain angle and epsilon combinations result in ZeroDivisionError in mpmath (e.g., theta=4.862909272689599 and epsilon=1e-8) or TypeError: '<' not supported between instances of 'mpc' and 'int' in pygridsynth (e.g., theta=1.42778299794038 and epsilon=1e-8).

Synthesizing random angles at 1e-8 can generate more examples:

from pygridsynth import gridsynth_gates
import numpy as np

eps = 1e-8
num_angles = 100
angles = np.random.default_rng(42).uniform(0, 2 * np.pi, size=num_angles)
for angle in angles:
    try:
        gridsynth_gates(angle, eps)
    except (ZeroDivisionError, TypeError) as e:
        print(eps, angle)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions