-
Notifications
You must be signed in to change notification settings - Fork 62
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
Why were the placers "custom" and "trivial" removed? #1556
Comments
Yes, the reason is that you can now just skip the placement step to achieve the same result. The transpiler object is essentially an instance of Each transformation is optional, and it can be applied multiple times. If you want to do nothing (as in |
Thanks so much for your reply and it's crystal clear. I found issue #1500, which defines the new attribute in the 'Circuit' class, along with other changes. |
Hello everybody, Between ourselves we have already discussed how this can be achieved with the Imagine, you have a circuit of 5 qubits, and you want to try it on different subgraphs of a chip of 10 qubits, to characterize noise/error of different parts of a chip, etc.. you could do it by looping and manually changing the Instead, if we leave the circuit still, and just change the You might say, well this can course be achieved, just doing a (The Tagging @alecandido and @carlos-luque since they were original people in the Issue |
Well, I would argue that building multiple transpilers, all with their own custom placers, is pretty much equivalent to add a step outside the transpiler itself: # With the custom placer
transpiler1 = ...
transpiler2 = ...
res1 = transpiler1(circuit).execute()
res2 = transpiler2(circuit).execute()
# Without the custom placer
def my_function_which_i_could_name_transpiler_even_without_being_an_instance1(c):
c = deepcopy(c)
c.wire_names = ...
return transpiler(c)
def my_function[...]2(c):
...
res1 = my_function[...]1(circuit).execute()
res2 = my_function[...]2(circuit).execute() and you could even make a single function which is generating them, given the permutation. I would say that adding another
|
Right, we can totally do that yes, I agree.
But of course, it can be done without it as you showed, and yes the discussion becomes a bit philosophical, without a single better answer, true.. We just think the UI/UX would be a bit better that way, but it's true you are adding a bit of duplication 🤔 |
In some sense, this is something I'm trying to account elsewhere, to make packages as much extensible as possible from users, such that you do not need to affect the distributed package source to support your use case. If you feel that it would be rather comfortable to you to have it as a transpiler step, you may just grab the class from a past commit qibo/src/qibo/transpiler/placer.py Lines 122 to 150 in 824bb76
and introduce it in your code. Even if it won't be defined as part of the qibo package, there is no reason why it should not work :)
|
Yeah, we were considering doing that if you refused, already ;) (but we have users import all |
Smart guys 😏
Well, my advice would be to avoid too much focus on what is ugly, since I usually do not have enough time to make things working and solid (no chance to make them beautiful...). I know that sometimes may be a bit confusing, but you may consider that even NumPy and SciPy are packages supposed to work together, to the point that some linear algebra operations, which you may expect to be NumPy's specialty, are actually part of As said, I'm just trying to keep things minimal, exactly because I'd like to commit in Qibo on making the interface stable, and focus on features that require deep integration, since it won't be as simple to provide them as extensions... In any case, if |
Makes sense, well thank you anyway, |
I'm wondering why the "custom" and "trivial" placers were removed in version 2.14. Are there any ways to achieve the same results in the current implementation?
The text was updated successfully, but these errors were encountered: