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

【PaddlePaddle Hackathon】81 时间演化电路的性能优化 #28

Merged
merged 10 commits into from
Nov 24, 2021

Conversation

yangguohao
Copy link
Contributor

@Quleaf
Copy link
Collaborator

Quleaf commented Nov 17, 2021

review 了你的代码,有一些还需要改进。__group_hamiltonian_optimial应该是用于判断并将哈密顿量重排列,但是在代码里并没有调用这个函数。以及在判断时,直接使用if pauli_words==['XX','YY','ZZ']可能还不够充分,缺少了对于sites信息的判断,而且这种判断必须要先用__group_hamiltonian_optimial进行重组才行。比如,如果我的泡利项是[Z0, Z1, X1, X2, Y3, Y4],目前的写法可能就会有问题。单独判断写一个__group_hamiltonian_optimial函数可能也不太合适,因为 __group 方法对应这物理上重新排列哈密顿量中每一项的顺序。这里的条件判断可能更应该是和add_n_pauli_gate并列的一个关系。
后续可以考虑用[[1., 'X0, X1'], [1., 'Z2, Z3'], [1., 'Y0, Y1'], [1., 'X1, X2'], [1., 'Y2, Y3'], [1., 'Z0, Z1']]进行测试。

@Quleaf
Copy link
Collaborator

Quleaf commented Nov 18, 2021

目前的代码倒是没有出错,但是会有一些漏掉的情况。当哈密顿量为 h = Hamiltonian([[1, 'X0, X1'], [1, 'Y0, Y1'], [1, 'Z0, Z1'], [1, 'X0, Y1'], ...]) 时,那么就对前三项加一个 optimal_circuit。但是如果我换一下顺序,比如当哈密顿量为 h = Hamiltonian([[1, 'X0, X1'], [1, 'X0, Y1'], [1, 'Y0, Y1'], [1, 'Z0, Z1'], ...]),优化效果可能就不会生效,因此希望可以进一步提升代码情况的覆盖范围。

@Quleaf Quleaf merged commit 99dee56 into PaddlePaddle:master Nov 24, 2021
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.

2 participants