question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

decompose() new parameters provide decompose multiple time, or till the end

See original GitHub issue

What should we add?

example:
circuit.decompose().decompose().decompose().decompose().decompose()

can be something like:

circuit.decompose(reps = 5) # repeat decompose 5 times

why: I found it useful when decompose initialize state, and see how gate change each decompose

  • repeat decompose #8142
  • repeat gates_to_decompose

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
jakelishmancommented, Aug 18, 2022

I explained in the other PR - I don’t see a need for any modification to gates_to_decompose here, and I think adding it would confuse the interface of a generally simple function. I’ll close the re-opened part of this issue (as it’s effectively a feature request) as “won’t fix”, but thanks for the initial PR!

1reaction
jakelishmancommented, Jun 6, 2022

This seems both easy to implement and a simple shorthand for people. In general, decompose isn’t the best way of translating between basis gates (the BasisTranslator transpiler pass is our preferrred method now), but I do know people still use decompose as a quick check.

I’d be happy to accept a PR on this that adds reps as the keyword argument in QuantumCircuit.decompose - it just needs to loop over the call to the Decomposer pass that many times.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multi-Seasonal Time Series Decomposition using MSTL in ...
It is a method to decompose a time series into a trend component, multiple seasonal components, and a residual component. MSTL assumes that...
Read more >
How to Decompose Time Series Data into Trend and ...
Time series decomposition involves thinking of a series as a combination of level, trend, seasonality, and noise components. Decomposition ...
Read more >
decompose() for time series: ValueError: You must specify a ...
The period parameter that is set with an integer means the number of cycles which you expect to be in the data. If...
Read more >
Time series decomposition gives unexpected results
Logic Used: Jan = 5, Increase by 5 till June, Decrease by 5 after that. Next year, add 1 to each value. Run...
Read more >
Introduction To Time Series In R: The Decompose Function
When developing time series models it can be helpful to understand the nature of the various patterns that exist inside the data.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found