forked from Qiskit/qiskit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Redesign implementing circuits and related stuff
- Loading branch information
Showing
7 changed files
with
184 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,22 @@ | ||
// The Python version embodiments.py is not used in XXDecomposer | ||
// itself. More precisely, functions and data in this file are | ||
// not reference in the module xx_decompose. | ||
// Rather it is meant to be (and is) used by consumers of XXDecomposer | ||
|
||
// We will keep embodiments in Python for the moment. | ||
// The easiest way to convert to Rust for the moment | ||
// is via CircuitData machinery | ||
use qiskit_circuit::operations::StandardGate as StdGate; | ||
use crate::xx_decompose::types::{GateData, Circuit2Q}; | ||
|
||
fn rzx_circuit(theta: f64) -> Circuit2Q { | ||
let gates = vec! [ | ||
GateData::oneq_no_param(StdGate::HGate, 0), | ||
GateData::twoq_param(StdGate::RZXGate, theta, 0, 1), | ||
GateData::oneq_no_param(StdGate::HGate, 0), | ||
]; | ||
Circuit2Q::from_gates(gates) | ||
} | ||
|
||
fn rzz_circuit(theta: f64) -> Circuit2Q { | ||
let gates = vec! [ | ||
GateData::oneq_no_param(StdGate::HGate, 0), | ||
GateData::oneq_no_param(StdGate::HGate, 1), | ||
GateData::twoq_param(StdGate::RZZGate, theta, 0, 1), | ||
GateData::oneq_no_param(StdGate::HGate, 0), | ||
GateData::oneq_no_param(StdGate::HGate, 1), | ||
]; | ||
Circuit2Q::from_gates(gates) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,4 @@ mod types; | |
mod weyl; | ||
mod polytopes; | ||
mod paths; | ||
mod embodiments; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.