Protocol and interface for quantum computing hardware backends.
This namespace defines the protocol for connecting to and executing quantum circuits on real quantum hardware or simulators. It provides a clean abstraction layer that allows the application to work with different quantum computing providers and simulators.
Protocol and interface for quantum computing hardware backends. This namespace defines the protocol for connecting to and executing quantum circuits on real quantum hardware or simulators. It provides a clean abstraction layer that allows the application to work with different quantum computing providers and simulators.
(analyze-measurement-results results)
Analyze measurement results and compute statistics.
Parameters:
Returns: Map with probabilities and statistics
Analyze measurement results and compute statistics. Parameters: - results: Map of measurement outcomes to counts Returns: Map with probabilities and statistics
(authenticated? backend)
Check if a cloud backend is currently authenticated.
Parameters:
Returns: True if authenticated, false otherwise
Check if a cloud backend is currently authenticated. Parameters: - backend: Cloud backend implementing CloudQuantumBackend protocol Returns: True if authenticated, false otherwise
(cloud-backend? backend)
Check if a backend is a cloud backend.
Parameters:
Returns: True if the backend implements CloudQuantumBackend protocol
Check if a backend is a cloud backend. Parameters: - backend: Backend to check Returns: True if the backend implements CloudQuantumBackend protocol
Extended protocol for cloud-based quantum computing backends.
This protocol extends the basic QuantumBackend with cloud-specific functionality including authentication, device topology, cost estimation, and batch operations.
Extended protocol for cloud-based quantum computing backends. This protocol extends the basic QuantumBackend with cloud-specific functionality including authentication, device topology, cost estimation, and batch operations.
(get-batch-results this batch-job-id)
Get results from a completed batch job.
Parameters:
Returns: Map of individual job results
Get results from a completed batch job. Parameters: - batch-job-id: Identifier for the batch job Returns: Map of individual job results
(authenticate this credentials)
Authenticate with the cloud quantum service.
Parameters:
Returns: Authentication token or session information
Authenticate with the cloud quantum service. Parameters: - credentials: Map containing authentication information (e.g., {:username 'user' :password 'pass'} or {:api-key 'key'}) Returns: Authentication token or session information
(get-device-topology this device-id)
Get the topology and coupling map for a specific device.
Parameters:
Returns: Device topology information including coupling map
Get the topology and coupling map for a specific device. Parameters: - device-id: Identifier for the quantum device Returns: Device topology information including coupling map
(get-session-info this)
Get current session information including authentication status.
Get current session information including authentication status.
(get-calibration-data this device-id)
Get calibration data for a specific device.
Parameters:
Returns: Current calibration data including gate errors and coherence times
Get calibration data for a specific device. Parameters: - device-id: Identifier for the quantum device Returns: Current calibration data including gate errors and coherence times
(estimate-cost this circuit options)
Estimate the cost of executing a circuit.
Parameters:
Returns: Cost estimation information
Estimate the cost of executing a circuit. Parameters: - circuit: Quantum circuit to estimate cost for - options: Execution options including shots and device Returns: Cost estimation information
(batch-submit this circuits options)
Submit multiple circuits as a batch job.
Parameters:
Returns: Batch job ID for tracking all submissions
Submit multiple circuits as a batch job. Parameters: - circuits: Collection of quantum circuits - options: Execution options applied to all circuits Returns: Batch job ID for tracking all submissions
(get-batch-status this batch-job-id)
Get status of a batch job.
Parameters:
Returns: Status information for all jobs in the batch
Get status of a batch job. Parameters: - batch-job-id: Identifier for the batch job Returns: Status information for all jobs in the batch
(list-available-devices this)
List all quantum devices available on this backend.
Returns: Collection of device information maps
List all quantum devices available on this backend. Returns: Collection of device information maps
(compare-gate-support backend1 backend2)
Compare gate support between two backends.
Parameters:
Returns: Map with comparison results including shared, unique to each backend
Compare gate support between two backends. Parameters: - backend1: First backend implementing QuantumBackend protocol - backend2: Second backend implementing QuantumBackend protocol Returns: Map with comparison results including shared, unique to each backend
(ensure-authenticated backend)
(ensure-authenticated backend credentials)
Ensure a cloud backend is authenticated, prompting for credentials if needed.
Parameters:
Returns: True if authentication successful, false otherwise
Ensure a cloud backend is authenticated, prompting for credentials if needed. Parameters: - backend: Cloud backend implementing CloudQuantumBackend protocol - credentials: Optional credentials map Returns: True if authentication successful, false otherwise
(estimate-execution-cost backend circuits options)
Estimate the total cost of executing circuits on a cloud backend.
Parameters:
Returns: Cost estimation map
Estimate the total cost of executing circuits on a cloud backend. Parameters: - backend: Cloud backend implementing CloudQuantumBackend protocol - circuits: Single circuit or collection of circuits - options: Execution options Returns: Cost estimation map
(execute-circuit backend circuit)
(execute-circuit backend circuit options)
Execute a quantum circuit on the specified backend.
This is a convenience function that handles the full workflow: submit circuit, wait for completion, and return results.
Parameters:
Returns: Job result map with measurement outcomes
Execute a quantum circuit on the specified backend. This is a convenience function that handles the full workflow: submit circuit, wait for completion, and return results. Parameters: - backend: An implementation of QuantumBackend protocol - circuit: Quantum circuit to execute - options: Execution options (defaults: 1024 shots) Returns: Job result map with measurement outcomes
(execute-circuit-async backend circuit)
(execute-circuit-async backend circuit options)
Execute a quantum circuit asynchronously.
Returns immediately with a job ID. Use get-job-status and get-job-result to track progress and retrieve results.
Parameters:
Returns: Job ID string
Execute a quantum circuit asynchronously. Returns immediately with a job ID. Use get-job-status and get-job-result to track progress and retrieve results. Parameters: - backend: An implementation of QuantumBackend protocol - circuit: Quantum circuit to execute - options: Execution options Returns: Job ID string
(filter-backends-by-gate-support backends required-gates)
Filter a collection of backends by their gate support.
Parameters:
Returns: Collection of backends that support all required gates
Filter a collection of backends by their gate support. Parameters: - backends: Collection of backends implementing QuantumBackend protocol - required-gates: Set or collection of gate keywords that must be supported Returns: Collection of backends that support all required gates
(find-best-device backend circuit & [options])
Find the best available device for a given circuit.
Considers factors like device availability, topology compatibility, and calibration quality.
Parameters:
Returns: Device ID of the best matching device, or nil if none suitable
Find the best available device for a given circuit. Considers factors like device availability, topology compatibility, and calibration quality. Parameters: - backend: Cloud backend implementing CloudQuantumBackend protocol - circuit: Quantum circuit to execute - options: Options map with preferences: - :prefer-online - Prefer online devices (default: true) - :min-qubits - Minimum number of qubits required - :max-error-rate - Maximum acceptable gate error rate Returns: Device ID of the best matching device, or nil if none suitable
(find-minimal-backend backends required-gates)
Find the backend with the minimal gate set that still supports required gates.
This is useful for finding the most constrained backend that can still execute a given circuit, which might be preferred for noise considerations.
Parameters:
Returns: Backend with smallest supported gate set that includes all required gates, or nil if no backend supports all required gates
Find the backend with the minimal gate set that still supports required gates. This is useful for finding the most constrained backend that can still execute a given circuit, which might be preferred for noise considerations. Parameters: - backends: Collection of backends implementing QuantumBackend protocol - required-gates: Set or collection of gate keywords that must be supported Returns: Backend with smallest supported gate set that includes all required gates, or nil if no backend supports all required gates
(get-unsupported-gates backend gates)
Get the set of gates from a collection that are not supported by a backend.
Parameters:
Returns: Set of unsupported gate keywords
Get the set of gates from a collection that are not supported by a backend. Parameters: - backend: Backend implementing QuantumBackend protocol - gates: Set or collection of gate keywords Returns: Set of unsupported gate keywords
Protocol for quantum computing hardware backends.
This protocol defines the interface that all quantum backends must implement, whether they are simulators, cloud services, or local hardware.
Protocol for quantum computing hardware backends. This protocol defines the interface that all quantum backends must implement, whether they are simulators, cloud services, or local hardware.
(cancel-job this job-id)
Cancel a queued or running job.
Cancel a queued or running job.
(get-backend-info this)
Get information about this backend including type, capabilities, and configuration.
Get information about this backend including type, capabilities, and configuration.
(get-job-result this job-id)
Get the results of a completed job.
Returns: A map containing measurement results and statistics.
Get the results of a completed job. Returns: A map containing measurement results and statistics.
(get-job-status this job-id)
Get the current status of a submitted job.
Get the current status of a submitted job.
(get-queue-status this)
Get information about the current job queue.
Get information about the current job queue.
(get-supported-gates this)
Get the set of quantum gates supported by this backend.
Returns: A set of gate keywords indicating which gates this backend can execute natively or through decomposition. The gate names correspond to those defined in org.soulspace.qclojure.domain.gate-registry.
Get the set of quantum gates supported by this backend. Returns: A set of gate keywords indicating which gates this backend can execute natively or through decomposition. The gate names correspond to those defined in org.soulspace.qclojure.domain.gate-registry.
(is-available? this)
Check if the backend is currently available for job submission.
Check if the backend is currently available for job submission.
(submit-circuit this circuit options)
Submit a quantum circuit for execution.
Parameters:
Returns: A job ID for tracking the execution.
Submit a quantum circuit for execution. Parameters: - circuit: A quantum circuit from qclojure.domain.quantum-circuit - options: Execution options including shot count Returns: A job ID for tracking the execution.
(supports-gate? backend gate)
Check if a backend supports a specific gate.
Parameters:
Returns: True if the gate is supported, false otherwise
Check if a backend supports a specific gate. Parameters: - backend: Backend implementing QuantumBackend protocol - gate: Gate keyword to check for support Returns: True if the gate is supported, false otherwise
(supports-gates? backend gates)
Check if a backend supports all gates in a set.
Parameters:
Returns: True if all gates are supported, false otherwise
Check if a backend supports all gates in a set. Parameters: - backend: Backend implementing QuantumBackend protocol - gates: Set or collection of gate keywords Returns: True if all gates are supported, false otherwise
(transform-circuit-for-backend circuit backend & [options])
Transform a quantum circuit to use only gates supported by a given backend.
Parameters:
Returns: A map containing:
Transform a quantum circuit to use only gates supported by a given backend. Parameters: - circuit: Quantum circuit to transform - backend: Target backend for the transformation - options: Optional map with transformation options: :max-iterations - Maximum number of decomposition iterations (default: 100) :transform-unsupported? - Whether to transform unsupported gates (default: true) Returns: A map containing: - :quantum-circuit - The transformed circuit - :transformed-operation-count - Count of gates that were transformed - :unsupported-gates - List of gate types that couldn't be transformed
(wait-for-job backend job-id)
(wait-for-job backend job-id timeout-ms)
Wait for a job to complete and return the result.
Parameters:
Returns: Job result map
Wait for a job to complete and return the result. Parameters: - backend: The backend where the job was submitted - job-id: Job identifier - timeout-ms: Maximum time to wait in milliseconds (default: 30000) Returns: Job result map
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close