«   2025/07   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
Recent Posts
관리 메뉴

갈라파고스

[Python] UserWarning: The value of the smallest subnormal for <class 'numpy.float64'> type is zero. 본문

연구/Python

[Python] UserWarning: The value of the smallest subnormal for <class 'numpy.float64'> type is zero.

9yelin9 2025. 3. 12. 19:00

양자 프로그래밍 언어는 대부분 Python 기반이다.

그래서 C나 Fortran 기반 프로그램에 임베딩 할 때, Python 함수를 부르는 C 함수를 불러서 사용해야 한다... (이상해요)

암튼 C 코드에서 Python.h를 임포트하고 컴파일하면 저 오류가 떠서... 컴퓨터를 부수기 직전 해결해냈다.

 

UserWarning: The value of the smallest subnormal for <class 'numpy.float64'> type is zero.

Makefile에서 컴파일러 옵션에 -fp-model strict를 추가한다.

CC = [...] -fp-model strict # C
FC = [...] -fp-model strict # Fortran

 

참고문헌

https://github.com/Qiskit/qiskit-aer/issues/1461

 

UserWarning: The value of the smallest subnormal for <class 'numpy.float64'> type is zero. · Issue #1461 · Qiskit/qiskit-aer

Informations Qiskit Aer version: 0b0913c Python version: 3.9.6 Operating system: RHEL 8.5 What is the current behavior? Importing AerSimulator gives a Numpy warning. Steps to reproduce the problem ...

github.com

https://moyix.blogspot.com/2022/09/someones-been-messing-with-my-subnormals.html

 

Someone’s Been Messing With My Subnormals!

TL;DR: After noticing an annoying warning, I went on an absurd yak shave, and discovered that because of a tiny handful of Python packages b...

moyix.blogspot.com

Comments