Skip to content
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

Improvements to HighLevelSynthesis transpiler pass #13605

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d0b4137
Moving all internal fields into a separate class
alexanderivrii Dec 11, 2024
1f5a694
making all the inner functions to be global
alexanderivrii Dec 11, 2024
2f2e140
moving handling annotated operations to plugin
alexanderivrii Dec 16, 2024
7db3493
improving control-modified synthesis plugin
alexanderivrii Dec 22, 2024
ec4f4e8
Merge branch 'main' into hls_reorg
alexanderivrii Dec 22, 2024
0a37fee
Changing internal functions to work with QuantumCircuits instead of D…
alexanderivrii Dec 22, 2024
a74f68e
renaming
alexanderivrii Dec 22, 2024
3fe0454
Removing unnecessary argument use_ancillas
alexanderivrii Dec 22, 2024
71fbf57
progress
alexanderivrii Dec 23, 2024
89b33ac
minor
alexanderivrii Dec 23, 2024
76e10a3
removing context
alexanderivrii Dec 23, 2024
5deb316
minor
alexanderivrii Dec 23, 2024
663a937
removing unused argument
alexanderivrii Dec 23, 2024
19bdbde
removing an obsolete statement
alexanderivrii Dec 24, 2024
8a73f4f
minor cleanup
alexanderivrii Dec 24, 2024
0a6950b
minor
alexanderivrii Dec 24, 2024
bbc2175
improvements to run method
alexanderivrii Dec 24, 2024
a02ed03
cleanup
alexanderivrii Dec 24, 2024
53c7dee
another pass over the run method + black
alexanderivrii Dec 24, 2024
23d2ef7
minor cleanup
alexanderivrii Dec 24, 2024
3f2904b
pass over synthesize_operation
alexanderivrii Dec 24, 2024
09f5c15
more cleanup
alexanderivrii Dec 24, 2024
1022ec4
pass over HLS::run
alexanderivrii Dec 24, 2024
56272b6
cleanup
alexanderivrii Dec 24, 2024
2d3e800
pass over annotated plugin
alexanderivrii Dec 25, 2024
5ea2ccb
cleanup
alexanderivrii Dec 25, 2024
1ffeba7
improving comment
alexanderivrii Dec 25, 2024
39e552b
fixing pylint
alexanderivrii Dec 25, 2024
919b549
remove print statements in tests
alexanderivrii Dec 25, 2024
9f2ef8d
fmt
alexanderivrii Dec 25, 2024
c5f0f0e
fix + test for controlling circuits with nontrivial phase
alexanderivrii Dec 25, 2024
b59dbe6
adding release notes
alexanderivrii Dec 25, 2024
27c66ba
adding test function docstring
alexanderivrii Dec 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions crates/accelerate/src/high_level_synthesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ impl QubitTracker {
}
}

fn num_qubits(&self) -> usize {
self.num_qubits
}

/// Sets state of the given qubits to dirty
fn set_dirty(&mut self, qubits: Vec<usize>) {
for q in qubits {
Expand Down Expand Up @@ -243,6 +247,25 @@ impl QubitContext {
fn to_globals(&self, qubits: Vec<usize>) -> Vec<usize> {
qubits.iter().map(|q| self.local_to_global[*q]).collect()
}

/// Pretty-prints
pub fn __str__(&self) -> String {
let mut out = String::from("QubitContext(");
for (q_loc, q_glob ) in self.local_to_global.iter().enumerate() {
out.push_str(&q_loc.to_string());
out.push(':');
out.push(' ');
out.push_str(&q_glob.to_string());

if q_loc != self.local_to_global.len() - 1 {
out.push(';');
out.push(' ');
} else {
out.push(')');
}
}
out
}
}

pub fn high_level_synthesis_mod(m: &Bound<PyModule>) -> PyResult<()> {
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ sk = "qiskit.transpiler.passes.synthesis.solovay_kitaev_synthesis:SolovayKitaevS
"Multiplier.cumulative_h18" = "qiskit.transpiler.passes.synthesis.hls_plugins:MultiplierSynthesisH18"
"PauliEvolution.default" = "qiskit.transpiler.passes.synthesis.hls_plugins:PauliEvolutionSynthesisDefault"
"PauliEvolution.rustiq" = "qiskit.transpiler.passes.synthesis.hls_plugins:PauliEvolutionSynthesisRustiq"
"annotated.default" = "qiskit.transpiler.passes.synthesis.hls_plugins:AnnotatedSynthesisDefault"

[project.entry-points."qiskit.transpiler.init"]
default = "qiskit.transpiler.preset_passmanagers.builtin_plugins:DefaultInitPassManager"
Expand Down
Loading
Loading