qat.frontend.parsers.qasm.qasm3 module
- class OpenPulseContext(**data)
Bases:
QasmContext
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
-
calibration_methods:
dict
[str
,Any
]
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'ser_json_inf_nan': 'constants', 'use_enum_values': False, 'validate_assignment': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
calibration_methods:
- class Qasm3Parser
Bases:
Interpreter
,AbstractParser
- assignment(tree)
- bit_declaration_statement(tree)
- cal_block(tree)
- calibration_definition(tree)
- calibration_grammar_declaration(tree)
- can_parse(qasm_str)
- Return type:
- complex_declaration_statement(tree)
- extern_frame(tree)
- extern_or_subroutine_call(tree)
- extern_port(tree)
- frame_attribute_assignment(tree)
- frame_definition(tree)
- gate_definition(tree)
- generate_expr_list_defcal_name(name, expr_list)
- get_waveform_samples(pulse)
- include(tree)
- initalize(builder)
- lark_parser = Lark(open('<string>'), parser='earley', lexer='dynamic', ...)
- parse(builder, qasm_str)
- parser_language()
- Return type:
Languages
- quantum_barrier(tree)
- quantum_declaration(tree)
- quantum_gate_call(tree)
- quantum_measurement(tree)
Throwaway measurement that doesn’t store results into any variable.
- quantum_measurement_assignment_statement(tree)
- quantum_reset(tree)
- return_statement(tree)
- timing_box(tree)
- timing_instruction(tree)
This is actually a delay instruction.
- transform_to_value(child_tree, walk_variable=True, return_variable=False)
- version(tree)
- walk_node(node, context, builder, **kwargs)
- waveform_definition(tree)
- class Qasm3ParserBase
Bases:
AbstractParser
,QASMVisitor
- add_cnot(control_qbs, target_qbs, builder)
- add_creg(reg_name, reg_length, context)
- add_delay(delay, qubits, builder)
- add_ecr(qubits, builder)
- add_if(left, right, if_body, context, builder)
- add_measure(qubits, bits, builder)
- add_qreg(reg_name, reg_length, context, builder)
- add_reset(qubits, builder)
- add_unitary(theta, phi, _lambda, qubit_or_register, builder)
- load_default_gates(context)
- Return type:
- modify(prog)
Allows children to transform the program before validation/transforming into our AST occurs.
- parse(builder, qasm)
- Return type:
- parser_language()
- Return type:
Languages
- process_program(prog, context)
- Return type:
- validate(prog)
- visit_BinaryExpression(node, context)
- visit_ClassicalDeclaration(node, context)
- visit_Identifier(node, context)
- visit_Include(node, context)
- visit_IndexedIdentifier(node, context)
- Return type:
list
- visit_IntegerLiteral(node, context)
- Return type:
int
- visit_QuantumGate(node, context)
- visit_QuantumGateDefinition(node, context)
- visit_QuantumMeasurement(node, context)
- visit_QuantumMeasurementStatement(node, context)
- visit_QubitDeclaration(node, context)
- visit_UnaryExpression(node, context)
- walk_node(node, context, builder, **kwargs)
- class UntargetedPulse(**data)
Bases:
Pulse
Pulse that currently has no device to send it down.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- property built
-
ignore_channel_scale:
Literal
[True
]
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'ser_json_inf_nan': 'constants', 'use_enum_values': False, 'validate_assignment': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
targets:
FrozenSet[str]
- get_frame_mappings(hw)
Generate the names for frames we allow in open pulse ‘extern’ statements. Returns a dictionary mapping name->pulse channel.
- get_port_mappings(hw)
Generate the names for ports we allow in open pulse ‘extern’ statements. Returns a dictionary mapping name->physical channel.