pub struct ParameterizedQuantumCircuit {
pub circuit: InterfaceCircuit,
pub parameters: Array1<f64>,
pub parameter_names: Vec<String>,
pub gate_parameter_map: HashMap<usize, Vec<usize>>,
pub hardware_optimizations: HardwareOptimizations,
}
Expand description
Parameterized quantum circuit for machine learning
Fields§
§circuit: InterfaceCircuit
Circuit structure
parameters: Array1<f64>
Parameter vector
parameter_names: Vec<String>
Parameter names for identification
gate_parameter_map: HashMap<usize, Vec<usize>>
Gate-to-parameter mapping
hardware_optimizations: HardwareOptimizations
Hardware-specific optimizations
Implementations§
Source§impl ParameterizedQuantumCircuit
impl ParameterizedQuantumCircuit
Sourcepub fn new(
circuit: InterfaceCircuit,
parameters: Array1<f64>,
parameter_names: Vec<String>,
hardware_architecture: HardwareArchitecture,
) -> Self
pub fn new( circuit: InterfaceCircuit, parameters: Array1<f64>, parameter_names: Vec<String>, hardware_architecture: HardwareArchitecture, ) -> Self
Create a new parameterized quantum circuit
Sourcepub fn update_parameters(
&mut self,
new_parameters: Array1<f64>,
) -> Result<(), String>
pub fn update_parameters( &mut self, new_parameters: Array1<f64>, ) -> Result<(), String>
Update circuit parameters
Sourcepub fn get_parameter(&self, index: usize) -> Option<f64>
pub fn get_parameter(&self, index: usize) -> Option<f64>
Get parameter at specific index
Sourcepub fn set_parameter(&mut self, index: usize, value: f64) -> Result<(), String>
pub fn set_parameter(&mut self, index: usize, value: f64) -> Result<(), String>
Set parameter at specific index
Sourcepub fn num_parameters(&self) -> usize
pub fn num_parameters(&self) -> usize
Get the number of parameters
Sourcepub fn num_qubits(&self) -> usize
pub fn num_qubits(&self) -> usize
Get the number of qubits
Sourcepub fn add_parameter_mapping(
&mut self,
gate_index: usize,
parameter_indices: Vec<usize>,
)
pub fn add_parameter_mapping( &mut self, gate_index: usize, parameter_indices: Vec<usize>, )
Add parameter mapping for a gate
Sourcepub fn get_parameter_mapping(&self, gate_index: usize) -> Option<&Vec<usize>>
pub fn get_parameter_mapping(&self, gate_index: usize) -> Option<&Vec<usize>>
Get parameter mapping for a gate
Sourcepub fn estimate_fidelity(&self) -> f64
pub fn estimate_fidelity(&self) -> f64
Estimate circuit fidelity based on hardware optimizations
Sourcepub fn estimate_execution_time(&self) -> f64
pub fn estimate_execution_time(&self) -> f64
Estimate total execution time
Sourcepub fn are_qubits_connected(&self, qubit1: usize, qubit2: usize) -> bool
pub fn are_qubits_connected(&self, qubit1: usize, qubit2: usize) -> bool
Check if two qubits are connected according to hardware topology
Sourcepub fn get_decoherence_time(&self, qubit: usize) -> Option<f64>
pub fn get_decoherence_time(&self, qubit: usize) -> Option<f64>
Get decoherence time for a specific qubit
Trait Implementations§
Source§impl Clone for ParameterizedQuantumCircuit
impl Clone for ParameterizedQuantumCircuit
Source§fn clone(&self) -> ParameterizedQuantumCircuit
fn clone(&self) -> ParameterizedQuantumCircuit
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ParameterizedQuantumCircuit
impl RefUnwindSafe for ParameterizedQuantumCircuit
impl Send for ParameterizedQuantumCircuit
impl Sync for ParameterizedQuantumCircuit
impl Unpin for ParameterizedQuantumCircuit
impl UnwindSafe for ParameterizedQuantumCircuit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.