qiskit-community / ibm-quantum-challenge-2024

For IBM Quantum Challenge 2024 (5-14 June 2024)
https://challenges.quantum.ibm.com/2024
Apache License 2.0
167 stars 238 forks source link

JSON serializable error #51

Open atul20027 opened 4 months ago

atul20027 commented 4 months ago

when i m submitting the option_0 and option_1 to the grade_lab4_ex7 ... it is giving the error

TypeError: Object of type UnsetType is not JSON serializable

jgs03177 commented 4 months ago

The grader checks the following parameters:

options.resilience_level,
options.dynamical_decoupling.enable,
options.dynamical_decoupling.sequence_type,
options.default_shots,
options.optimization_level

However, some parameters are Unset, which the grader cannot read. Try setting all the parameters.

HavokSahil commented 4 months ago

@jgs03177 Considering I turn options.dynamical_decoupling.enable to False, what should I put in options.dynamical_decoupling.sequence_type, it seems it's required anyway

vantnprof commented 4 months ago

I tried set all required parameters, but the answer was incorrrect. Do you guys know what wrong in my case? Thank you for your reading.

# Submit your answer using following code
options_0 = EstimatorOptions()
options_0.default_shots = 5000
options_0.optimization_level = 0
options_0.resilience_level = 0
options_0.dynamical_decoupling.enable = False
options_0.dynamical_decoupling.sequence_type = "XX"
options_0.resilience.measure_mitigation = False
# options_0.twirling.enable_gates = False
options_0.twirling.enable_measure = False
options_0.resilience.zne_mitigation = False

options_1 = EstimatorOptions()
options_1.default_shots = 5000
options_1.optimization_level = 0
options_1.resilience_level = 1
options_1.dynamical_decoupling.enable = True
options_1.dynamical_decoupling.sequence_type = "XpXm"
options_1.resilience.measure_mitigation = False
# options_1.twirling.enable_gates = False
options_1.twirling.enable_measure = False
options_1.resilience.zne_mitigation = False

grade_lab4_ex7(options_0, options_1) # Expected answer type: EstimatorOptions, EstimatorOptions
HavokSahil commented 4 months ago

@vantnprof "XpXm" in dd sequence type for option_0 worked for me

vantnprof commented 4 months ago

Thanks for your sharing. It worked!