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

Set precision cmake #182

Open
wants to merge 27 commits into
base: set-precision
Choose a base branch
from
Open

Set precision cmake #182

wants to merge 27 commits into from

Conversation

KowerKoint
Copy link
Contributor

#177 をできるだけライブラリにコンパイルできるように大幅にCMakeの構成を変えました。
また、ninja -C build installでscaluqをシステムにインストールできるようになりました。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ninja installでシステムに追加したscaluqライブラリが他のプロジェクトで使えるかどうかをテストする項目を追加しました。
また、pip installもシステムにインストールするという括りでこっちのワークフローに移動しました。

endif(NOT DEFINED SCALUQ_USE_TEST)
if(NOT DEFINED SCALUQ_USE_EXE)
set(SCALUQ_USE_EXE ON)
set(SCALUQ_USE_EXE OFF)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

システムにインストールしたいだけの人を優先してデフォルト値を変更

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scaluqを使った他のプロジェクトの設定例です

.def("set_computational_basis",
&StateVector<double>::set_computational_basis,
"Initialize with computational basis \\ket{\\mathrm{basis}}.")
.def("get_amplitudes",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pythonでの関数名がamplitudesになっていましたが、C++でのものに合わせて変更しました

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここの関数たちはユーザーがincludeできる必要はないのでupdate_ops.hppみたいにヘッダごとsrc/に移動させるかも(internal名前空間で切ってるし割とどっちでもいい)

Comment on lines -53 to -68
dev = [
"mypy == 1.11.2",
"scikit-build == 0.17.6",
"typing_extensions == 4.12.0",
"numpy == 1.26.0",
"nanobind == 2.0.0"
]

ci = [
"mypy == 1.11.2",
"scikit-build == 0.17.6",
"typing_extensions == 4.12.0",
"numpy == 1.26.0",
"nanobind == 2.0.0"
]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使う意義が殆ど無い気がしたので消しました

Kokkos::kokkos
Eigen3::Eigen
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eigenはヘッダオンリーなのでinclude指定に移動しました

"__str__", \
[](const GATE_TYPE& gate) { return gate->to_string(""); }, \
#define DEF_GATE_BASE(GATE_TYPE, FLOAT, DESCRIPTION) \
nb::class_<GATE_TYPE<FLOAT>>(m, #GATE_TYPE, DESCRIPTION) \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GATE_TYPEにが入った状態でそのままclass_の引数に#GATE_TYPEが入れられるとPythonの型名に<double>が入って困る(コンストラクタ使えなかったりmypyに引っかかったりする)ので変えました

@KowerKoint KowerKoint marked this pull request as ready for review November 15, 2024 04:02
KowerKoint and others added 2 commits November 22, 2024 12:32
merge_gate for control/dense with new cmake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant