Coder Social home page Coder Social logo

Comments (5)

CalMacCQ avatar CalMacCQ commented on August 26, 2024

Hi, thank you for raising an issue for this.

Can I ask which OS you are using? This may be a platform dependent issue as I do not get the assertion failure when I run your code snippet on my mac.

from tket.

nquetschlich avatar nquetschlich commented on August 26, 2024

Hi, thank you for raising an issue for this.

Can I ask which OS you are using? This may be a platform dependent issue as I do not get the assertion failure when I run your code snippet on my mac.

Hi, thank you very much for your fast response. I actually do also use a mac with MacOs 13.0.1. Not sure if it helps, but I use pytket-qiskit v0.31.0, qiskit-terra v0.22.2 and qiskit v0.39.2.

from tket.

CalMacCQ avatar CalMacCQ commented on August 26, 2024

Hi,

I am not sure of the exact reason for the assertion failure in this case as I can't reproduce the error. I suspect it comes from small parameter values in the phase estimation circuit.

I think we should investigate this behaviour further. After discussing this I think we will remove this assertion in a future release and make it warning instead.

Its possible to change the target gateset of the FullPeepholeOptimise to target TK2 gates by using

FullPeepholeOptimise(target_2qb_gate=OpType.TK2).apply(qc_tket)

Do you still get the error message if you target TK2 gates? I think this may bypass the replace_TK2_2CX .

from tket.

nquetschlich avatar nquetschlich commented on August 26, 2024

Hi,

for me there was a threshold regarding num_evaluation_qubits from which the error started to appear - maybe increasing it e.g., to 50, would also trigger the error in your setup.

Thanks for that suggestion, it avoids the error message. Would you be able to give an estimate in how far the added parameter affects the resulting optimization quality?

from tket.

CalMacCQ avatar CalMacCQ commented on August 26, 2024

Hi,

I would have thought that increasing the number of evaluation qubits may reproduce the error as well. However I can increase the number up to 90 without seeing the issue which surprised me.

Regarding targetting TK2 vs CX....

If I run your original code snippet targeting CX gates with FullPeepholeOptimise I get a circuit with
#total gates = 1968
#CX gates = 861
CX depth = 117

If Instead I target TK2 gates with the same example I get the following

#total gates = 1017
#TK2 gates = 445
TK2 depth = 67

The improvement in gate count/depth with TK2 is expected as it is a parameterised gate and therefore more expressive than CX.

As for which one is better I suppose it depends on the emulator/device that you're using. TK2 gates were added as an intermediate step to target the Quantinuum device gate set whereas CX gates are native to IBM devices.

from tket.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.