Integer division for casts, int array elements, bitwise results, ** and int-returning subroutines

オープン
#480 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
compilers

調査の方向性

Start from the integer-division handling added in #474 and the type rules in language/types.rst and language/classical.rst. Locate where binary / is typed and where casts, array indexing, bitwise/shift results, **, and int/uint subroutine returns get their types, then add regression cases for the four snippets in the issue. Done when each snippet uses integer division and existing division tests still pass.

索引モデルが issue の本文から書いたものです。

説明

After #474, / divides as integers when both operands are integer literals or int/uint variables. Other integer-typed operands still use true division:

OPENQASM 3.0;
include "stdgates.inc";
qubit[1] q;
int[32] a = 2;
int[32] b = 3;
float[64] f = 7.9;
array[int[32], 2] arr = {7, 1};
def h() -> int[32] { return 7; }
rx(int[32](f) / a) q[0];   // rx(3.5), spec gives 3
rx(arr[0] / a) q[0];       // rx(3.5), spec gives 3
rx((b | 4) / a) q[0];      // rx(3.5), spec gives 3
rx(h() / a) q[0];          // rx(3.5), spec gives 3

Casts to int/uint, elements of integer arrays, bitwise and shift results on integers, int ** int, and subroutines that return int/uint are all integer-typed in the spec (language/types.rst, language/classical.rst). Raised in the review of #474.

主要言語
Python
スター
29
フォーク
33
平均マージ
1日 3時間
マージ済み PR(30日)
14

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

qBraid/pyqasm のほかの issue

qBraid/pyqasm の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。