qbraid_algorithms.evolution.TransverseFieldIsing
- class qbraid_algorithms.evolution.TransverseFieldIsing(reg=3, j=1.0, h=0.5, *args, **kwargs)
Transverse Field Ising Model Hamiltonian: H = -J∑ZZ + h∑X
Combines nearest-neighbor ZZ interactions with transverse X fields. This creates strong non-commutativity between different terms. formulation is not a direct matrix embedding but is intended for use in series product formulation under small time steps
- __init__(reg=3, j=1.0, h=0.5, *args, **kwargs)
Initialize the gate library with necessary components.
- Parameters:
gate_import – List of imported gate libraries
gate_ref – List of available gate names
gate_defs – Dictionary of gate definitions
program_append – Function to append code to the program
builder – Reference to the circuit builder
annotated – Whether to use annotated syntax
Methods
__init__([reg, j, h])Initialize the gate library with necessary components.
add_gate(name, gate_def)Add a custom gate definition to the library.
add_var(name[, assignment, qtype])simple stub for programatically adding a variable
apply(time, qubits)Apply TFIM evolution for given time.
begin_gate(name, qargs[, params])GATE DEFINITION
begin_if(conditional)CONDITIONAL BLOCK
begin_loop(iterator[, ident])LOOPS
begin_subroutine(name, parameters[, return_type])SUBROUTINE DEFINITION
call_gate(gate, target[, controls, phases, ...])GATE APPLICATION
call_subroutine(subroutine, parameters[, ...])SUBROUTINE APPLICATION
close_scope()Close the current scope block and decrease indentation level.
comment(line)COMMENTS
controlled(time, qubits, control)Apply controlled TFIM evolution.
controlled_op(gate_call, params[, n])CONTROLLED OPERATIONS
end_gate()End gate definition block.
end_if()End conditional block.
end_loop()End loop block.
end_subroutine()End subroutine definition block.
inverse_op(gate_call, params)INVERSE OPERATIONS
measure(qubits, clbits)MEASUREMENT
merge(program, imports, definitions, name)Merges data from a built library/GateBuilder into the current library bases scope :type program: :param program: Gate body which is added into definitions :type imports: :param imports: all imports the gate depends on :param gate_def: Gate definitions for any child gates/dynamic libraries used
Attributes
name