Class Result

java.lang.Object
com.quantum4j.core.backend.Result

public final class Result extends Object
Immutable container for quantum circuit execution results.

Stores measurement outcome counts from multiple circuit executions (shots). Each key is a classical bit string (e.g., "110") and each value is the number of times that outcome was measured across all shots.

  • Constructor Details

    • Result

      public Result(Map<String,Integer> counts)
      Construct a Result from measurement counts.
      Parameters:
      counts - map of classical bit strings to outcome frequencies
    • Result

      public Result(Map<String,Integer> counts, BackendType backendType, StateVector stateVector)
      Construct a Result from measurement counts and backend metadata.
      Parameters:
      counts - map of classical bit strings to outcome frequencies
      backendType - backend that produced this result
      stateVector - optional final statevector (may be null)
  • Method Details

    • getCounts

      public Map<String,Integer> getCounts()
      Get the measurement outcome counts.
      Returns:
      immutable map of bit strings to outcome counts
    • getBackendType

      public BackendType getBackendType()
      Get the backend type used for execution.
      Returns:
      backend type
    • getStateVector

      public StateVector getStateVector()
      Get the final statevector, if available.
      Returns:
      statevector or null
    • toString

      public String toString()
      Overrides:
      toString in class Object