pub struct AMDOpenCLSimulator { /* private fields */ }Expand description
AMD GPU-optimized quantum simulator using OpenCL
Implementations§
Source§impl AMDOpenCLSimulator
impl AMDOpenCLSimulator
Sourcepub fn new(config: OpenCLConfig) -> Result<Self>
pub fn new(config: OpenCLConfig) -> Result<Self>
Create new AMD OpenCL simulator
Sourcepub fn create_buffer(
&mut self,
name: &str,
size: usize,
flags: MemoryFlags,
) -> Result<()>
pub fn create_buffer( &mut self, name: &str, size: usize, flags: MemoryFlags, ) -> Result<()>
Create memory buffer
Sourcepub fn execute_kernel(
&mut self,
kernel_name: &str,
global_work_size: &[usize],
local_work_size: Option<&[usize]>,
args: &[KernelArg],
) -> Result<f64>
pub fn execute_kernel( &mut self, kernel_name: &str, global_work_size: &[usize], local_work_size: Option<&[usize]>, args: &[KernelArg], ) -> Result<f64>
Execute kernel
Sourcepub fn apply_single_qubit_gate_opencl(
&mut self,
gate_matrix: &[Complex64; 4],
target_qubit: usize,
num_qubits: usize,
) -> Result<f64>
pub fn apply_single_qubit_gate_opencl( &mut self, gate_matrix: &[Complex64; 4], target_qubit: usize, num_qubits: usize, ) -> Result<f64>
Apply single qubit gate using OpenCL
Sourcepub fn apply_two_qubit_gate_opencl(
&mut self,
gate_matrix: &[Complex64; 16],
control_qubit: usize,
target_qubit: usize,
num_qubits: usize,
) -> Result<f64>
pub fn apply_two_qubit_gate_opencl( &mut self, gate_matrix: &[Complex64; 16], control_qubit: usize, target_qubit: usize, num_qubits: usize, ) -> Result<f64>
Apply two qubit gate using OpenCL
Sourcepub fn compute_expectation_value_opencl(
&mut self,
pauli_string: u32,
num_qubits: usize,
) -> Result<(f64, f64)>
pub fn compute_expectation_value_opencl( &mut self, pauli_string: u32, num_qubits: usize, ) -> Result<(f64, f64)>
Compute expectation value using OpenCL
Sourcepub const fn get_device_info(&self) -> Option<&OpenCLDevice>
pub const fn get_device_info(&self) -> Option<&OpenCLDevice>
Get device information
Sourcepub const fn get_stats(&self) -> &OpenCLStats
pub const fn get_stats(&self) -> &OpenCLStats
Get performance statistics
Sourcepub fn reset_stats(&mut self)
pub fn reset_stats(&mut self)
Reset performance statistics
Sourcepub const fn is_opencl_available(&self) -> bool
pub const fn is_opencl_available(&self) -> bool
Check if OpenCL is available
Sourcepub fn fallback_to_cpu(&mut self, num_qubits: usize) -> Result<()>
pub fn fallback_to_cpu(&mut self, num_qubits: usize) -> Result<()>
Fallback to CPU simulation
Auto Trait Implementations§
impl !Freeze for AMDOpenCLSimulator
impl !RefUnwindSafe for AMDOpenCLSimulator
impl Send for AMDOpenCLSimulator
impl Sync for AMDOpenCLSimulator
impl Unpin for AMDOpenCLSimulator
impl !UnwindSafe for AMDOpenCLSimulator
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> 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.