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

change method name #161

Merged
merged 6 commits into from
Sep 3, 2024
Merged

change method name #161

merged 6 commits into from
Sep 3, 2024

Conversation

gandalfr-KY
Copy link
Contributor

class old_name new_name description
Circuit gate_count n_gates 違和感ありました 異論あれば遠慮なく
Gate/ParamGate get_*_qubit_list/mask *_qubit_list/mask
PauliGate 他 get_pauli_id_list pauli_id_list
StateVector(Batched) amplitudes get_amplitudes GPUからの転送コスト大

@gandalfr-KY
Copy link
Contributor Author

gandalfr-KY commented Aug 27, 2024

ついでに触れると Circuit::get も何を get するのかわかりにくそう

Copy link
Contributor

@KowerKoint KowerKoint left a comment

Choose a reason for hiding this comment

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

👍

@KowerKoint
Copy link
Contributor

Circuit::get、qulacsの人がCircuitのことを配列と同じインターフェースで使ってほしくてつけたんだろうけど、sizeはgate_countだし微妙なので、get_gate_atとかでいいかも

@@ -25,12 +25,12 @@ class StateVector {
/**
* @attention Very slow. You should use load() instead if you can.
*/
void set_amplitude_at_index(std::uint64_t index, const Complex& c);
void set_amplitude_at(std::uint64_t index, const Complex& c);
Copy link
Contributor

Choose a reason for hiding this comment

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

_atに統一できていてかなりわかりやすいです!
ありがとうございます

This was linked to issues Sep 3, 2024
@gandalfr-KY
Copy link
Contributor Author

ParamGateの命名変更もついでに対応しました。

@gandalfr-KY
Copy link
Contributor Author

追加で変更した分のまとめです

class old_name new_name description
Circuit get get_gate_at
Circuit get_key get_param_key_at
ParamGate P* Param*
ParamGate pcoef param_coef
StateVector set/get_amplitude_at_index set/get_amplitude_at

@KowerKoint
Copy link
Contributor

ParamGateの変更もOKです!ありがとうございます
怪しい変更がないことと、変更漏れがないことをチェックしました

@gandalfr-KY gandalfr-KY merged commit a24aac3 into main Sep 3, 2024
4 checks passed
@gandalfr-KY gandalfr-KY deleted the 145 branch September 11, 2024 09:43
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.

ParamGateの命名 getter/setterの命名
2 participants