braket.analog_hamiltonian_simulator.rydberg.rydberg_simulator_helpers module
- braket.analog_hamiltonian_simulator.rydberg.rydberg_simulator_helpers.validate_config(config: str, atoms_coordinates: ndarray, blockade_radius: float) bool [source]
Valid if a given configuration complies with the Rydberg approximation
- Parameters:
config (str) – The configuration to be validated
atoms_coordinates (ndarray) – The coordinates for atoms in the filled sites
blockade_radius (float) – The Rydberg blockade radius
- Returns:
bool – True if the configuration complies with the Rydberg approximation, False otherwise
- braket.analog_hamiltonian_simulator.rydberg.rydberg_simulator_helpers.get_blockade_configurations(lattice: AtomArrangement, blockade_radius: float) list[str] [source]
Return the lattice configurations complying with the blockade approximation
- Parameters:
lattice (AtomArrangement) – A lattice with Rydberg atoms and their coordinates
blockade_radius (float) – The Rydberg blockade radius
- Returns:
list[str] – A list of bit strings, each of them corresponding to a valid configuration complying with the blockade approximation. The length of each configuration is the same as the number of atoms in the lattice, with ‘r’ and ‘g’ indicating the Rydberg and ground states, respectively.
Notes on the indexing: The left-most bit in the configuration corresponds to the first atom in the lattice.
Notes on the algorithm: We start from all possible configurations and get rid of those violating the blockade approximation constraint.
- braket.analog_hamiltonian_simulator.rydberg.rydberg_simulator_helpers.sample_state(state: ndarray, shots: int) ndarray [source]
Sample measurement outcomes from the quantum state
state
- Parameters:
state (ndarray) – A state vector
shots (int) – The number of samples
- Returns:
ndarray – The array for the sample results