Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in CSQASampler() #217

Open
j-i-k-o opened this issue Oct 7, 2021 · 0 comments
Open

Error in CSQASampler() #217

j-i-k-o opened this issue Oct 7, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@j-i-k-o
Copy link
Collaborator

j-i-k-o commented Oct 7, 2021

Describe the bug
CSQASampler() causes the NoneType-related error.

To Reproduce

>>> import openjij as oj
>>> h = {0: -1, 1: -1, 2: 1, 3: 1}
>>> J = {(0, 1): -1, (3, 4): -1}
>>> sampler = oj.CSQASampler()
>>> res = sampler.sample_ising(h, J)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.9/site-packages/openjij/sampler/csqa_sampler.py", line 103, in sample_ising
    self._annealing_schedule_setting(
  File "/usr/local/lib/python3.9/site-packages/openjij/sampler/sqa_sampler.py", line 228, in _annealing_schedule_setting
    self._schedule, beta_gamma = quartic_ising_schedule(
  File "/usr/local/lib/python3.9/site-packages/openjij/sampler/sqa_sampler.py", line 270, in quartic_ising_schedule
    s = np.linspace(0, 1, num_sweeps)
  File "<__array_function__ internals>", line 5, in linspace
  File "/usr/local/lib/python3.9/site-packages/numpy/core/function_base.py", line 120, in linspace
    num = operator.index(num)
TypeError: 'NoneType' object cannot be interpreted as an integer

Expected behavior

  • No error outputs

Environment (please complete the following information):

  • OS: Arch Linux
  • Version: Python 3.9.6

Additional context

@j-i-k-o j-i-k-o added the bug Something isn't working label Oct 7, 2021
@j-i-k-o j-i-k-o closed this as completed Feb 19, 2022
@j-i-k-o j-i-k-o reopened this Feb 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant