`denormals_are_zeros` setting has unexpected side effects
Maintainer thường phản hồi trong vòng 2 ngày
@msoud2509 đang làm issue này rồi.
Từ ngày 13/9/2026.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Start by running the reproduction in the issue: it checks that ctypes.c_float(1e-40) keeps its value after QSimSimulator(qsim_options=QSimOptions(denormals_are_zeros=True)).simulate(cirq.Circuit()). The payload does not name the source files, so search the C++ simulator and its Python binding for where the flush-to-zero and denormals-are-zero flags are set. Done means the flags are restored after each simulate call, including when the simulation raises. The closed, unmerged pull request #1111 is a prior attempt worth reading first.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
qsim updates global flush-to-zero and denormals-are-zero control flags, but never resets them to their original values. This can lead to unexpected changes in the behavior of downstream code, e.g.:
import cirq
import ctypes
from qsimcirq import QSimOptions, QSimSimulator
orig_value = ctypes.c_float(1e-40).value
_ = QSimSimulator(qsim_options=QSimOptions(denormals_are_zeros=False)).simulate(cirq.Circuit())
assert ctypes.c_float(1e-40).value == orig_value # passes
_ = QSimSimulator(qsim_options=QSimOptions(denormals_are_zeros=True)).simulate(cirq.Circuit())
assert ctypes.c_float(1e-40).value == orig_value # fails
_ = QSimSimulator().simulate(cirq.Circuit())
assert ctypes.c_float(1e-40).value == orig_value # passes
it would be nice if these flags were reset after the simulation (ideally even if the simulation itself fails)
- Ngôn ngữ chính
- C++
- Star
- 702
- Fork
- 219
- Merge trung bình
- 1 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 8
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của quantumlib/qsim
-
`MPSStateSpace::Sample` accesses results out of bounds when the output vector is emptyCó thể đã có người làm @aadityarshah đã nhận 42 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
quantumlib/qsim#1126 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 57/100
quantumlib/qsim#1146 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
quantumlib/qsim#1145 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
`MPSStateSpace::SampleOnce` crashes for two-qubit statesCó thể đã có người làm @aadityarshah đã nhận 40 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
quantumlib/qsim#1129 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Implement expectation values for the MPS SimulatorCó thể đã có người làm @rupasri118 đã nhận 36 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
quantumlib/qsim#1122 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của quantumlib/qsim
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ai_p1 comp-sql-syntax
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
ClickHouse/ClickHouse#133888 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation good first issue
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 66/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
jbcoe/cc-protocol#507 ·
Maintainer thường phản hồi trong vòng 1 ngày