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

There might be some issues in the NoiseModelTQ class. And provided a potential fix to it. #108

Merged
merged 2 commits into from
Apr 6, 2023

Conversation

caitaozhan
Copy link
Collaborator

@caitaozhan caitaozhan commented Apr 3, 2023

Hi Hanrui,

In this open issue: #104 (comment), I mentioned that the profiling of sampling Pauli error gates is not what I expected.

In the old code, I mostly see Pauli Z errors sampled for sx gate, and a few Pauli Z errors sampled for cx gate. What should be like is that 1) the number of errors for double qubit errors (cx) are orders of magnitude higher than the number of errors for single qubit gates (sx); and 2) the number of Pauli X, Y, Z errors are kind of even.

I figured out that there might be some issues in the NoiseModelTQ class, and fixed them (mostly, may still have issues). Now the profiling of Pauli error gates is close to what I expect. An example of the current Pauli errors sampled is shown below (factor=1, no need to increase factor to a larger number):

single qubit error: pauli x = 0, pauli y = 0, pauli z = 6
double qubit error: pauli x = 73, pauli y = 54, pauli z = 65

References:

  1. 1 and 2 qubit gate errors consisting of a depolarizing_error() followed by a thermal_relaxation_error()
  2. depolarization.

Thanks,
Caitao

…ct and 2) NoiseModelTQ.sample_noise_op. Also update the example/quantumnat/quantumnat.py accordingly
@Hanrui-Wang
Copy link
Collaborator

Hi Caitao,

Thank you for the pull request! I have reviewed it and the quantumnat.py looks good to me. For the noise model, I have a question, when will the 'pauli' directly appear in the instructions?

@caitaozhan
Copy link
Collaborator Author

Hi Hanhui,

According to what I observed, instruction["name"] == "pauli" appears when the op_name is a 'cx' gate.

torchquantum/noise_model.py Show resolved Hide resolved
@Hanrui-Wang
Copy link
Collaborator

Hi Caitao,

yes, I see the 'pauli' in the 'cx' noise dict. for my understanding, the code now also record the prob for the two qubit pauli and applied them one by one if the error is sampled (the 'kraus' and 'id' are ignored for now). I will merge it.

@Hanrui-Wang Hanrui-Wang merged commit aa9882d into mit-han-lab:main Apr 6, 2023
0 of 2 checks passed
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.

None yet

2 participants