Skip to content

Commit

Permalink
refactor: move QuantumModel out of ViewModel
Browse files Browse the repository at this point in the history
  • Loading branch information
linderd committed Feb 21, 2024
1 parent 986b142 commit 002bc25
Show file tree
Hide file tree
Showing 55 changed files with 67 additions and 66 deletions.
4 changes: 2 additions & 2 deletions QuIDE/CodeHelpers/CodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
using System.Numerics;
using System.Reflection;
using System.Text;
using QuIDE.ViewModels.MainModels.QuantumModel;
using QuIDE.ViewModels.MainModels.QuantumModel.Gates;
using QuIDE.QuantumModel;
using QuIDE.QuantumModel.Gates;
using QuIDE.ViewModels.MainModels.QuantumParser;

#endregion
Expand Down
1 change: 1 addition & 0 deletions QuIDE/QuIDE.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<ItemGroup>
<Folder Include="Models"/>
<AvaloniaResource Include="Assets\**"/>
<Folder Include="ViewModels\MainModels\QuantumModel\Gates\" />
<None Remove="Assets\Images\CopyHS.png"/>
<AvaloniaResource Include="Assets\Images\CopyHS.png"/>
<None Remove="Assets\Images\CutHS.png"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ You should have received a copy of the GNU General Public License
using System.Linq;
using System.Numerics;
using Avalonia.Interactivity;
using QuIDE.ViewModels.MainModels.QuantumModel.Gates;
using QuIDE.QuantumModel.Gates;

#endregion

namespace QuIDE.ViewModels.MainModels.QuantumModel
namespace QuIDE.QuantumModel
{
public class ComputerModel
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ You should have received a copy of the GNU General Public License

#endregion

namespace QuIDE.ViewModels.MainModels.QuantumModel.Gates
namespace QuIDE.QuantumModel.Gates
{
public abstract class AngleGate : SingleGate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You should have received a copy of the GNU General Public License

#endregion

namespace QuIDE.ViewModels.MainModels.QuantumModel.Gates
namespace QuIDE.QuantumModel.Gates
{
public class CNotGate : Gate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You should have received a copy of the GNU General Public License

#endregion

namespace QuIDE.ViewModels.MainModels.QuantumModel.Gates
namespace QuIDE.QuantumModel.Gates
{
public class CPhaseShiftGate : MultiControlledGate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

namespace QuIDE.ViewModels.MainModels.QuantumModel.Gates
namespace QuIDE.QuantumModel.Gates
{
public class CompositeGate : CustomGate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

namespace QuIDE.ViewModels.MainModels.QuantumModel.Gates
namespace QuIDE.QuantumModel.Gates
{
public abstract class CustomGate : Gate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

namespace QuIDE.ViewModels.MainModels.QuantumModel.Gates
namespace QuIDE.QuantumModel.Gates
{
public class EmptyGate : Gate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

namespace QuIDE.ViewModels.MainModels.QuantumModel.Gates
namespace QuIDE.QuantumModel.Gates
{
public enum GateName
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You should have received a copy of the GNU General Public License

#endregion

namespace QuIDE.ViewModels.MainModels.QuantumModel.Gates
namespace QuIDE.QuantumModel.Gates
{
public class HadamardGate : SingleGate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You should have received a copy of the GNU General Public License

#endregion

namespace QuIDE.ViewModels.MainModels.QuantumModel.Gates
namespace QuIDE.QuantumModel.Gates
{
public class InvCPhaseShiftGate : MultiControlledGate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

namespace QuIDE.ViewModels.MainModels.QuantumModel.Gates
namespace QuIDE.QuantumModel.Gates
{
public class MeasureGate : Gate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ You should have received a copy of the GNU General Public License

#endregion

namespace QuIDE.ViewModels.MainModels.QuantumModel.Gates
namespace QuIDE.QuantumModel.Gates
{
public abstract class MultiControlledGate : Gate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ You should have received a copy of the GNU General Public License

#endregion

namespace QuIDE.ViewModels.MainModels.QuantumModel.Gates
namespace QuIDE.QuantumModel.Gates
{
public class ParametricGate : CustomGate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You should have received a copy of the GNU General Public License

#endregion

namespace QuIDE.ViewModels.MainModels.QuantumModel.Gates
namespace QuIDE.QuantumModel.Gates
{
public class PhaseKickGate : MultiControlledGate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You should have received a copy of the GNU General Public License

#endregion

namespace QuIDE.ViewModels.MainModels.QuantumModel.Gates
namespace QuIDE.QuantumModel.Gates
{
public class PhaseScaleGate : AngleGate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You should have received a copy of the GNU General Public License

#endregion

namespace QuIDE.ViewModels.MainModels.QuantumModel.Gates
namespace QuIDE.QuantumModel.Gates
{
public class RotateXGate : AngleGate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You should have received a copy of the GNU General Public License

#endregion

namespace QuIDE.ViewModels.MainModels.QuantumModel.Gates
namespace QuIDE.QuantumModel.Gates
{
public class RotateYGate : AngleGate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You should have received a copy of the GNU General Public License

#endregion

namespace QuIDE.ViewModels.MainModels.QuantumModel.Gates
namespace QuIDE.QuantumModel.Gates
{
public class RotateZGate : AngleGate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You should have received a copy of the GNU General Public License

#endregion

namespace QuIDE.ViewModels.MainModels.QuantumModel.Gates
namespace QuIDE.QuantumModel.Gates
{
public class SigmaXGate : SingleGate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You should have received a copy of the GNU General Public License

#endregion

namespace QuIDE.ViewModels.MainModels.QuantumModel.Gates
namespace QuIDE.QuantumModel.Gates
{
public class SigmaYGate : SingleGate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You should have received a copy of the GNU General Public License

#endregion

namespace QuIDE.ViewModels.MainModels.QuantumModel.Gates
namespace QuIDE.QuantumModel.Gates
{
public class SigmaZGate : SingleGate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You should have received a copy of the GNU General Public License

#endregion

namespace QuIDE.ViewModels.MainModels.QuantumModel.Gates
namespace QuIDE.QuantumModel.Gates
{
public abstract class SingleGate : Gate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You should have received a copy of the GNU General Public License

#endregion

namespace QuIDE.ViewModels.MainModels.QuantumModel.Gates
namespace QuIDE.QuantumModel.Gates
{
public class SqrtXGate : SingleGate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You should have received a copy of the GNU General Public License

#endregion

namespace QuIDE.ViewModels.MainModels.QuantumModel.Gates
namespace QuIDE.QuantumModel.Gates
{
public class ToffoliGate : MultiControlledGate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ You should have received a copy of the GNU General Public License

#endregion

namespace QuIDE.ViewModels.MainModels.QuantumModel.Gates
namespace QuIDE.QuantumModel.Gates
{
public class UnitaryGate : SingleGate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ You should have received a copy of the GNU General Public License

#endregion

namespace QuIDE.ViewModels.MainModels.QuantumModel
namespace QuIDE.QuantumModel
{
public class OutputState
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You should have received a copy of the GNU General Public License
using Avalonia.Interactivity;
using Quantum;

namespace QuIDE.ViewModels.MainModels.QuantumModel
namespace QuIDE.QuantumModel
{
public class OutputViewModel
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

namespace QuIDE.ViewModels.MainModels.QuantumModel
namespace QuIDE.QuantumModel
{
public enum QubitModel
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ You should have received a copy of the GNU General Public License

#endregion

namespace QuIDE.ViewModels.MainModels.QuantumModel
namespace QuIDE.QuantumModel
{
public class RegisterModel
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You should have received a copy of the GNU General Public License

#endregion

namespace QuIDE.ViewModels.MainModels.QuantumModel
namespace QuIDE.QuantumModel
{
public struct RegisterPartModel : IEquatable<RegisterPartModel>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You should have received a copy of the GNU General Public License

#endregion

namespace QuIDE.ViewModels.MainModels.QuantumModel
namespace QuIDE.QuantumModel
{
public struct RegisterRefModel : IEquatable<RegisterRefModel>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You should have received a copy of the GNU General Public License

#endregion

namespace QuIDE.ViewModels.MainModels.QuantumModel
namespace QuIDE.QuantumModel
{
public struct Selection : IEquatable<Selection>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ You should have received a copy of the GNU General Public License

using System.Collections.Generic;
using System.Collections.ObjectModel;
using QuIDE.ViewModels.MainModels.QuantumModel.Gates;
using QuIDE.QuantumModel.Gates;

#endregion

namespace QuIDE.ViewModels.MainModels.QuantumModel
namespace QuIDE.QuantumModel
{
public class StepModel
{
Expand Down
2 changes: 1 addition & 1 deletion QuIDE/ViewModels/Controls/CircuitGridViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
using Avalonia.Input;
using Avalonia.Interactivity;
using QuIDE.CodeHelpers;
using QuIDE.QuantumModel;
using QuIDE.ViewModels.Helpers;
using QuIDE.ViewModels.MainModels.QuantumModel;

#endregion

Expand Down
2 changes: 1 addition & 1 deletion QuIDE/ViewModels/Controls/OutputGridViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
using System.Numerics;
using Avalonia.Interactivity;
using QuIDE.CodeHelpers;
using QuIDE.QuantumModel;
using QuIDE.ViewModels.Helpers;
using QuIDE.ViewModels.MainModels.QuantumModel;
using QuIDE.ViewModels.MainModels.QuantumParser;

#endregion
Expand Down
4 changes: 2 additions & 2 deletions QuIDE/ViewModels/Controls/PropertiesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
using QuIDE.CodeHelpers;
using QuIDE.Properties;
using QuIDE.ViewModels.Helpers;
using QuIDE.ViewModels.MainModels.QuantumModel;
using QuIDE.ViewModels.MainModels.QuantumModel.Gates;
using QuIDE.ViewModels.MainModels.QuantumParser;
using QuIDE.ViewModels.MainModels.QuantumParser.Validation;
using Quantum.Helpers;
using QuIDE.QuantumModel;
using QuIDE.QuantumModel.Gates;

#endregion

Expand Down
2 changes: 1 addition & 1 deletion QuIDE/ViewModels/Dialog/CompositeInputViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Collections.Generic;
using System.Reflection;
using QuIDE.CodeHelpers;
using QuIDE.ViewModels.MainModels.QuantumModel;
using QuIDE.QuantumModel;

#endregion

Expand Down
2 changes: 1 addition & 1 deletion QuIDE/ViewModels/Dialog/NewRegisterInputViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
using System.Numerics;
using System.Windows.Input;
using QuIDE.CodeHelpers;
using QuIDE.ViewModels.MainModels.QuantumModel;
using Quantum;
using Quantum.Helpers;
using QuIDE.QuantumModel;

#endregion

Expand Down
4 changes: 2 additions & 2 deletions QuIDE/ViewModels/Dialog/ParametricInputViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
using System.Linq;
using System.Reflection;
using System.Text;
using QuIDE.QuantumModel;
using QuIDE.QuantumModel.Gates;
using QuIDE.ViewModels.Helpers;
using QuIDE.ViewModels.MainModels.QuantumModel;
using QuIDE.ViewModels.MainModels.QuantumModel.Gates;
using QuIDE.ViewModels.MainModels.QuantumParser;

#endregion
Expand Down
Loading

0 comments on commit 002bc25

Please sign in to comment.