[Performance] Resource counting for a bloq.adjoint() needs a bloq decomposition even when my_static_cost or build_call_graph is implemented for the bloq

Đang mở
#1,841 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
python

Hướng nghiên cứu

Read the Bloq APIs for build_call_graph, my_static_cost, and adjoint(), then trace how bloq.adjoint().call_graph() and qubit counting currently obtain their results. Define and check the intended behavior for adjoints, including the measurement-based uncomputing caveat; the issue also notes controlled Bloqs as a related case. Done means the supported behavior is decided and implemented with coverage for call graphs and static cost.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Using the call_graph example (but it applies similarly to qubit count/my_static_cost):

If one defines a Bloq with a build_call_graph, then calls bloq.adjoint().call_graph(), the current behaviour in Qualtran is to call for the bloq.adjoint() decomposition, which can, especially when working with big circuit, lead to performance issue.

However with most Bloq, the call_graph of bloq.ajdoint() is simply the "adjoint of the original bloq.call_graph()" ie, the original bloq.call_graph() with every element replace by its adjoint.
Do you think it is possible to get bloq.adjoint() call_graph to be the adjoint of the call_graph by default or via an optional argument ?
This could obviously raise issue in situation where the adjoint is very different (for example when doing measurement based uncomputing), which is why it should probably remain optional.

The same problem arise when using my_static_cost, for example when estimating qubit count, (and in this case, I believe the qubit count of bloq.adjoint() should always be the same as the bloq).

There is a similar issue when using bloq.controlled(), however this one is probably more complex.

Currently the solution I am using is to create a wrapper bloq for the adjoint version, but it does involve a lot of verbose which would be nice to avoid.

Let me know what you think.

Ngôn ngữ chính
Python
Star
397
Fork
127
Merge trung bình
2 ngày 19 giờ
Pull request đã merge (30 ngày)
4

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của quantumlib/Qualtran

Tất cả issue của quantumlib/Qualtran

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.