Enhance network generation capabilities with string parsing and connection management #168
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new feature for generating a network from a string representation and manage connections between hosts in the QuNetSim library. This module simplifies the process of setting up complex quantum and classical network topologies.
Key Features
Syntax
Alice <==> Bob
: to represent a classical and quantum connection.Alice <~~> Bob
: to represent a quantum only connection.Alice <--> Bob
: to represent a classical only connection.All connections are added uni-directionally, so
<
and>
represent the direction of the flow of traffic.Documentation and Examples:
README.md
: Added a new quick example demonstrating how to generate a network from a string.examples/network_generated/send_qubit.py
: Added a new example script showcasing the usage of the network generation feature.New Modules and Functions:
qunetsim/__init__.py
: Updated to import the new generator module.qunetsim/generator/__init__.py
: Added a docstring and imported thenetwork_generate
function.qunetsim/generator/conn_type.py
: IntroducedConnType
class to handle different connection types.qunetsim/generator/connection.py
: AddedConnection
class to represent connections between hosts.qunetsim/generator/direction.py
: AddedDirection
class to handle connection directions.qunetsim/generator/generate.py
: Implemented functions to parse network strings and generate networks.