-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: set-precision
Are you sure you want to change the base?
Set precision cmake #182
Conversation
.github/workflows/install.yml
Outdated
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
システムにインストールしたいだけの人を優先してデフォルト値を変更
example_project/CMakeLists.txt
Outdated
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pythonでの関数名がamplitudes
になっていましたが、C++でのものに合わせて変更しました
include/scaluq/util/utility.hpp
Outdated
There was a problem hiding this comment.
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名前空間で切ってるし割とどっちでもいい)
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" | ||
] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
使う意義が殆ど無い気がしたので消しました
Kokkos::kokkos | ||
Eigen3::Eigen |
There was a problem hiding this comment.
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) \ |
There was a problem hiding this comment.
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に引っかかったりする)ので変えました
merge_gate for control/dense with new cmake
#177 をできるだけライブラリにコンパイルできるように大幅にCMakeの構成を変えました。
また、
ninja -C build install
でscaluqをシステムにインストールできるようになりました。