-
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
merge_gateのcontrol, DenseMatrix対応 #180
Conversation
"build/_deps/eigen-src", | ||
"build/_deps/googletest-src/googletest/include", |
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.
FetchContent_MakeAvailableを使うようにしたとき、ディレクトリの名前が変わっていました
@@ -126,7 +126,7 @@ if ((${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") OR (${CMAKE_CXX_COMPILER_ID} STREQ | |||
endif() | |||
|
|||
# Debug options | |||
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | |||
if ((${CMAKE_SYSTEM_NAME} MATCHES "Darwin") OR CMAKE_CUDA_COMPILER) |
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_USE_CUDA=Yesのとき
g++: fatal error: cannot specify ‘-o’ with ‘-c’, ‘-S’ or ‘-E’ with multiple files
compilation terminated.
があったので対応
gate2->target_qubit_list(), | ||
gate2->control_qubit_mask() & ~common_control_mask, | ||
merged_operand_vector); | ||
auto matrix = matrix2 * matrix1; |
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.
if (pauli_id2 == 3) return {gate::Y(target1), Kokkos::numbers::pi / 2}; | ||
if (pauli_id2 == 2) { | ||
if (gate1_control_mask == 0) { | ||
return {gate::Z(target1, control_list), -Kokkos::numbers::pi / 2}; |
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.
YX=-iZのようにGlobalPhase付きで返したいところなのですが、controlつきのGlobalPhaseを返しても嬉しくないのでそれより下のPauliGate生成やDenseMatrix生成にフォールバックします
@@ -88,33 +88,45 @@ inline internal::ComplexMatrix kronecker_product(const internal::ComplexMatrix& | |||
|
|||
inline internal::ComplexMatrix get_expanded_matrix(const internal::ComplexMatrix& from_matrix, | |||
const std::vector<std::uint64_t>& from_targets, | |||
std::vector<std::uint64_t>& to_targets) { | |||
std::uint64_t from_control_mask, | |||
std::vector<std::uint64_t>& to_operands) { |
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.
controlを加味したexpandができるようになりました。
from_control_maskが1の部分以外はIとします
@@ -17,7 +17,8 @@ CMAKE_OPS="-D CMAKE_C_COMPILER=${CMAKE_C_COMPILER} | |||
-D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \ | |||
-D SCALUQ_USE_OMP=${SCALUQ_USE_OMP} \ | |||
-D SCALUQ_USE_CUDA=${SCALUQ_USE_CUDA} \ | |||
-D SCALUQ_USE_TEST=${SCALUQ_USE_TEST}" | |||
-D SCALUQ_USE_TEST=${SCALUQ_USE_TEST} \ | |||
-D SCALUQ_USE_EXE=${SCALUQ_USE_EXE}" |
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.
抜けてたので修正
if (gate_type1 == GateType::I) return {gate2, 0.}; // copy can be removed by #125 | ||
if (gate_type1 == GateType::Probablistic || gate_type2 == GateType::Probablistic) { | ||
throw std::runtime_error( | ||
"merge_gate(const Gate&, const Gate&): ProbablisticGate is not supported."); |
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.
確率ごとにmergeして生成することはできますが、今の所optimizeにしか使いみちがないのでなしとします。
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.
よさそうです
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.
とてもいいと思います!ありがとうございます!
ただ、main.cppの利用例が削除されたのが削除されている部分が気になったのですが、これは理由がありますか?
特にないです。 |
#183 に移動 |
close #149 #141
controlありのmerge_gateに対応しました