• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Qiskit / qiskit / 6387639473
88%

Build:
DEFAULT BRANCH: main
Ran 03 Oct 2023 02:17AM UTC
Jobs 1
Files 1265
Run time 26s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

03 Oct 2023 12:43AM UTC coverage: 87.015% (+0.008%) from 87.007%
6387639473

push

github

web-flow
Improve the ergonomics of the TranspileLayout class (#10835)

* Improve the ergonomics of the TranspileLayout class

This commit updates the TranspileLayout class to make it easier to work
with. The TranspileLayout class was orginally just an a container class
that took the information returned from the transpiler needed to reverse
the transpiler layout permutation (in the absence of ancillas) so that
`QuantumCircuit.from_circuit()` could compare Operator instances across
a `transpile()`. However, the internal data structures used by the
transpiler are hard to work with, and don't map well to the normal
reasoning around how the transpiler transforms the circuit. To improve
the usability of the class this commit adds 4 new methods to the class:

 - initial_layout_list() and final_layout_list() which compute a list
   form of the initial_layout and final_layout respectively
 - full_layout() which generates a list that maps the input circuits
   qubit positions in the input circuit to the final position at
   the end of the circuit (which is what most people think of when they
   hear "final layout")
 - permute_sparse_pauli_op() which takes in a SparsePauliOp object and
   permutes it based on the full layout. This is especially useful when
   combined with the Estimator primitive

To implement these functions a few extra pieces of information are
needed to fully implement them. The first is we need to know the number
of original circuit qubits. This is used to account for any ancillas
that are added in the circuit, once we have the input circuit count we
can use the original_qubit_indices attribute to discern which qubits in
the initial layout are from the original circuit and which are ancillas.
The second piece of information needed is the list of qubits in the
output circuit. as this is needed to look up the position of the virtual
qubit in the final_layout. These are both added as optional private
attributes to the TranspileLayout class and there ar... (continued)

69 of 69 new or added lines in 5 files covered. (100.0%)

74157 of 85223 relevant lines covered (87.02%)

91273.22 hits per line

Jobs
ID Job ID Ran Files Coverage
1 6387639473.1 03 Oct 2023 02:17AM UTC 0
87.02
GitHub Action Run
Source Files on build 6387639473
Detailed source file information is not available for this build.
  • Back to Repo
  • 19854d19 on github
  • Prev Build on gh-readonly-queue/main/pr-10660-e24eee24879b0f848a7bbad23ffa4c9d5108baca (#6384024394)
  • Next Build on main (#6394675399)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc