A verifiable quantum advantage towards real world applications: Quantum Echoes 
Learn more
         
     
  
  
  
  
  
    
      cirq.read_json
  
      
    
  
  
  
  
  
    
  
  
    
    
Read a JSON file that optionally contains cirq objects.
cirq.read_json(
    file_or_fn: (None | IO | pathlib.Path | str) = None,
    *,
    json_text: (str | None) = None,
    resolvers: (Sequence[JsonResolver] | None) = None
)
Used in the notebooks
| Args | 
|---|
| file_or_fn | A filename (if a string or pathlib.Path) to read from, or
an IO object (such as a file or buffer) to read from, orNoneto
indicate thatjson_textargument should be used. Defaults toNone. | 
| json_text | A string representation of the JSON to parse the object from,
or else Noneindicatingfile_or_fnshould be used. Defaults toNone. | 
| resolvers | A list of functions that are called in order to turn
the serialized cirq_typestring into a constructable class.
By default, top-level cirq objects that implement the SupportsJSON
protocol are supported. You can extend the list of supported types
by pre-pending custom resolvers. Each resolver should returnNoneto indicate that it cannot resolve the given cirq_type and that
the next resolver should be tried. | 
| Raises | 
|---|
| ValueError | If either none of file_or_fnandjson_textis specified,
or both are specified. | 
  
  
 
  
    
    
      
    
    
  
       
    
    
  
  
  Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
  Last updated 2025-08-14 UTC.
  
  
  
    
      [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-14 UTC."],[],[]]